vue-wrap

VueJS directive to wrap children slots
3,283
Install
npm install vue-wrap
Latest Version:1.0.1
License:MIT
Last Updated:Jun 12, 2018
Links: npm
Maintainer: y_nk

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.

Related Packages

vue3-highlight-text

a vue3 directive of highlight text

84,789
vue-proportion-directive

vue 固定元素比例指令

6,003 10
ardirectives

Ardirectives

811
vue-axios

A small wrapper for integrating axios to Vuejs

5,218,200 1,996
vue-lodash

A small wrapper for integrating lodash into VueJs

853,868 105

Version History

Version Released License
1.0.1 MIT
1.0.0 MIT