1.0.1 • Published 9 months ago
vue-vnode-hook v1.0.1
Installation
npm i vue-vnode-hook -S
Examples
install
import Vue from 'vue'
import VNodeHook from 'vue-vnode-hook'
Vue.use(VNodeHook)
register hooks
import VNodeHook from 'vue-vnode-hook'
VNodeHook.register({
tag: 'el-select',
beforeCreate(ctx, tag, data, children) {
// do something
// you can set data.attrs before the vm was instantiated,
// this is equivalent to adding the attribute to the HTML tag.
// You can append vnode in children,
// this is equivalent to adding child elements inside HTML tags.
},
created(ctx, tag, vnode) {
// do something
// At this time, the vnode has been created, and you can access and modify the vnode.
},
})
Licence
This repository is licensed under the Apache License 2.0 license.