Skip to content

Instantly share code, notes, and snippets.

View tomtev's full-sized avatar
🔷
Flatsome

Tommy Vedvik tomtev

🔷
Flatsome
View GitHub Profile
@tomtev
tomtev / ChildClasses.vue
Last active January 10, 2020 15:30
A simple Vue wrapper component that let you add classes to all children.
<script>
export default {
name: 'ChildClasses',
functional: true,
render (h, ctx) {
return ctx.children.map((vnode, index) => {
let { tag, data = {} } = vnode
let props = ctx.props
let children = vnode.children
let on = data.on || {}