mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-12-02 04:01:52 +08:00
27 lines
418 B
JavaScript
27 lines
418 B
JavaScript
|
|
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;
|
|
},
|
|
}
|
|
}
|