We know that in jsx you can assign values to props like this
const props = { a: 1, b: 1, } render() { return ( ) }
In vue, although I am able to do this
// ... data() { return { props: { a: 1, b: 1, }, }, },
But the difference from the above is that my-comp actually only receives a prop ofsome-props
(an object attribute), instead of gettinga## like jsx #,
bTwo props (properties with value expansion).
The difference between object properties and expanded properties is that the former is inconvenient for props verification.
If I want to achieve the same effect as jsx, I have to write like this // ... data() { return { props: { a: 1, b: 1, }, }, },
It’s super annoying to write like this, because you often have to write a lot of props.
Then the question is, is it possible to implement the abbreviation in jsx in vue?
Pay attention. Also, what about this?
Then write jsx in the render function instead of template? Escape