oil-station/gasStation-uni/node_modules/@dcloudio/uni-ui/lib/uni-popup/popup.js
2024-09-24 17:24:39 +08:00

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;
},
}
}