Skip to content
  • This project
    • Loading...
  • Sign in

杨炀 / ztx_wx_gzt

Go to a project
Toggle navigation
Toggle navigation pinning
  • Projects
  • Groups
  • Snippets
  • Help
  • Project
  • Activity
  • Repository
  • Pipelines
  • Graphs
  • Issues 0
  • Merge Requests 0
  • Wiki
  • Network
  • Create a new issue
  • Builds
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Network
  • Compare
  • Branches
  • Tags
Switch branch/tag
  • ztx_wx_gzt
  • uni_modules
  • uni-popup
  • components
  • uni-popup
  • popup.js
  • 杨炀's avatar
    init · a7520530
    杨炀 committed 2023-10-08 10:09:56 +0800
    a7520530
popup.js 418 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

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