javascript - How to render custom components in vue
phpcn_u1582
phpcn_u1582 2017-06-28 09:28:58
0
1
909

The code is as shown below:

cbutton is a custom component. In case 1, it is normal without any problem. In case 2, v-html can only render native components.
2 requires dynamic output. Does this situation need to be solved by using render? What about jsx?
I have never used the render function, please help me

phpcn_u1582
phpcn_u1582

reply all(1)
淡淡烟草味

The official document clearly states that v-html can only render pure html

The first method has been written out. Wouldn’t it be better if you set up a template and directly traverse the nodes?

<template v-for="e in arr">
    <cbutton :type="e.type" :msg="e.msg">
</template>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template