vue-wrap
vue-wrap
VueJS directive to wrap children
Why
Because I wanted to wrap slots on the fly, but I couldn't. It's useful to wrap components over lists with <li> and such.
How
- Install the directive :
npm install vue-wrap - Include the directive :
require('vue-wrap') - use the directive :
Vue.component('OrderedList', { template: : '<ol v-wrap:li><slot /></ol>' }) <App> <OrderedList> <Components v-for='item in items' id="item.id" /> </OrderedList> </App>
Feel free to raise issues or submit PRs.
Related Packages
Version History
| Version | Released | License |
|---|---|---|
| 1.0.1 | MIT | |
| 1.0.0 | MIT |