Subscribe on changes!

The template function supports JS functions

avatar
Feb 22nd 2021

What problem does this feature solve?

In the template I would like to use the following js function:

{# // Parsing JS syntax is supported here function() { return (hello world) } #}

What does the proposed API look like?

{# // Parsing JS syntax is supported here function() { return (hello world) } #} or This function only supports the render function {# h('span', null, 'hello world') #}

avatar
Feb 22nd 2021

I don't see any benefit from your proposal, templates are different from jsx, mixing them will only cause more confusion. And also, if you are requesting new features, you should go through an RFC, https://github.com/vuejs/rfcs

avatar
Feb 22nd 2021

With JSX support in templates, the syntax is much more flexible. For example, it can handle pre-rendered data that can be processed at the time of acquisition or computed, but this is not flexible after development. This is where React is great