-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
createElement()
has been called outside of render function. when handleSuccessMessage function used
#804
Comments
Can you share a minimal reproduction? Thanks. |
https://codesandbox.io/s/sleepy-lederberg-50px2?file=/src/main.js |
1.2.1 has same problem, 1.1.5 is ok |
em...same problem, v1.2.4 |
Stale issue message |
v1.4.3 has same problem. |
|
Any updates on this? |
Let's check about export const createElement = function createElement(...args: any) {
const instance = getCurrentInstance()?.proxy
if (!instance) {
__DEV__ &&
warn('`createElement()` has been called outside of render function.')
if (!fallbackCreateElement) {
fallbackCreateElement = defineComponentInstance(
getVueConstructor()
).$createElement
}
return fallbackCreateElement.apply(fallbackCreateElement, args)
}
return instance.$createElement.apply(instance, args)
} as CreateElement
Remember that we can't get instance out of The solution is calling |
PR welcome to bypass the warning in this case. |
… handleSuccessMessage function used vuejs#804
content: () => h('div', {}, [h('p', '使用函数返回正确执行')]) |
这个是错的,需要给h绑定vm |
该如何去做呢,该段代码我并没有(也不需要)在template写任何html代码 |
const vm = getCurrentInstance() |
The text was updated successfully, but these errors were encountered: