You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have extracted the JSX template into another SFC, it is pretty complicated, but it works! I found something interesting when I used function declaration directly in the script tag of a SFC outside of the render function, I got an error that prompted me "h is not defined", but when I used the function declaration inside an Object, like const testTemplateGenerator = { renderColFormItem() { return ( <h1>123</h1> ) } } // call in render function: return testTemplateGenerator.renderColFormItem.call(this),
The error is gone! I guess that curly braces may create a scope that provides the "h" function.
Hi there.
I defined a variable:
columns
in column-config.js :And use it in App.vue:
Then I got errors in console:
TypeError: h is not a function
Here is my code: jsx-demo
Is there any way to return templates in
.js
files outsiderender
anddata
function?Thx.
The text was updated successfully, but these errors were encountered: