1.0.4 • Published 5 years ago

vue-slot-ops v1.0.4

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

vue-slot-ops

what

a handy Vue.js mixin to do various operations in slots

TL;DR

  1. npm i -s vue-slot-ops
  2. import ops from 'vue-slot-ops'
  3. mixins: [ ops({
      filter: e => e.tag === 'img',
      limit: 2,
      wrap: 'li',
    }) ]

why

I've been doing the same tools with a component (vue-b-slot), which i believe was the right choice... if we have native fragments. The implementation I've been rolling with vue-fragment is good for some use-cases, but probably not for an other npm component. This attempt is mixin based, so it wires on your actual component instead, and hack into the render function to work on slots. It's quite easy code to understand, so I hope you'll find it handy.

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago