plugins.js 文件
import test from ‘./test.vue’
const aa = {
install(Vue) {
const con = Vue.extend(test)
const inst = new con()
inst.$mount(document.createElement('div'))
document.body.appendChild(inst.$el)
Vue.prototype.$focusPersonDetail = (data, callback) => {
inst.data = data
inst.callback = callback
}
}
}
export default aa
main.js 文件
import aa from ‘./views/cms/focusPerson/plugins’;
Vue.use(aa);