1.0.1 • Published 6 years ago

vue-wrap v1.0.1

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

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

  1. Install the directive : npm install vue-wrap
  2. Include the directive : require('vue-wrap')
  3. 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.