Skip to content

Instantly share code, notes, and snippets.

@johannes-z
johannes-z / customDirectives.js
Last active September 8, 2017 13:17
[WIP] Vue directive to generate HTML from a (scoped) slot and values.
import Vue from 'vue'
/**
* Usage:
* <span v-slot:one="{ slots, value: 'component B2' }"></span>
* v-slot:<SLOT_NAME>="{ slots, <VALUE> }"
*
* Pass the slots like this:
* <my-component :slots="$scopedSlots" />
* inside MyComponent define props: ['slots']