How can I make a component similar to vue-router router-link where I get the tag via props to render my template ?
router-link
<my-component tag="ul"> </my-component>
Would render:
<ul> anything inside my-component </ul>
You can use a built-in component element like so:
component
<component is="ul" class="foo" style="color:red"> anything inside component </component>
See: https://vuejs.org/v2/guide/components.html#Dynamic-Components
1.4m articles
1.4m replys
5 comments
57.0k users