You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
418 B
26 lines
418 B
|
|
export default {
|
|
data() {
|
|
return {
|
|
|
|
}
|
|
},
|
|
created(){
|
|
this.popup = this.getParent()
|
|
},
|
|
methods:{
|
|
/**
|
|
* 获取父元素实例
|
|
*/
|
|
getParent(name = 'uniPopup') {
|
|
let parent = this.$parent;
|
|
let parentName = parent.$options.name;
|
|
while (parentName !== name) {
|
|
parent = parent.$parent;
|
|
if (!parent) return false
|
|
parentName = parent.$options.name;
|
|
}
|
|
return parent;
|
|
},
|
|
}
|
|
}
|
|
|