简体   繁体   中英

How can I render component as data attribute in VueJS

For example I have a template and some other <my-component> :

template: '<i data-toggle="popover" data-html="true" data-content="**Here I need render another  component in loop**"></i>'

This

 :data-content="<my-component v-for... ></my-component>"

doesn't work. Perhaps there is a method to render my-component in another place ? In computed area... or in methods ?

So, how can I render component in html data-*attributes ?

Thank you.

You will have to convert your component to be functional. Read Introduction to Vue.js Render Functions and Render Functional Components in Vue.js

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM