// 导入组件
import Components from ‘./index.vue’
const verify = {}
// 使用方法
verify.install = Vue => {
const PopupConstructor = Vue.extend(Components)
const instance = new PopupConstructor()
instance.
m
o
u
n
t
(
d
o
c
u
m
e
n
t
.
c
r
e
a
t
e
E
l
e
m
e
n
t
(
′
d
i
v
′
)
)
d
o
c
u
m
e
n
t
.
b
o
d
y
.
a
p
p
e
n
d
C
h
i
l
d
(
i
n
s
t
a
n
c
e
.
mount(document.createElement('div')) document.body.appendChild(instance.
mount(document.createElement(′div′))document.body.appendChild(instance.el)
Vue.prototype.$verify = {
show(callBack) {
instance.callBack = callBack
instance.show = true
},
hide() {
instance.show = false
}
}
}
export default verify