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