mirror of
				https://gitee.com/vant-contrib/vant.git
				synced 2025-10-27 01:32:10 +08:00 
			
		
		
		
	fix popup
This commit is contained in:
		
							parent
							
								
									ba53bc4c56
								
							
						
					
					
						commit
						b2cf1d1eb2
					
				| @ -1,7 +1,19 @@ | ||||
| import Vue from 'vue'; | ||||
| import merge from 'src/utils/merge'; | ||||
| import PopupManager from './popup-manager'; | ||||
| 
 | ||||
| let idSeed = 1; | ||||
| let popupContext; | ||||
| if (Vue.prototype.$isServer) { | ||||
|   popupContext = global.popupContext || {}; | ||||
|   global.popupContext = popupContext; | ||||
| } else { | ||||
|   popupContext = window.popupContext || {}; | ||||
|   window.popupContext = popupContext; | ||||
| } | ||||
| 
 | ||||
| popupContext = merge(popupContext, { | ||||
|   idSeed: 1 | ||||
| }); | ||||
| 
 | ||||
| const getDOM = function(dom) { | ||||
|   if (dom.nodeType === 3) { | ||||
| @ -58,7 +70,7 @@ export default { | ||||
|   }, | ||||
| 
 | ||||
|   beforeMount() { | ||||
|     this._popupId = 'popup-' + idSeed++; | ||||
|     this._popupId = 'popup-' + popupContext.idSeed++; | ||||
|     PopupManager.register(this._popupId, this); | ||||
|   }, | ||||
| 
 | ||||
|  | ||||
| @ -1,17 +1,21 @@ | ||||
| import Vue from 'vue'; | ||||
| import merge from 'src/utils/merge'; | ||||
| import { addClass } from 'src/utils/dom'; | ||||
| 
 | ||||
| let popupContext = { | ||||
| let popupContext; | ||||
| if (Vue.prototype.$isServer) { | ||||
|   popupContext = global.popupContext || {}; | ||||
|   global.popupContext = popupContext; | ||||
| } else { | ||||
|   popupContext = window.popupContext || {}; | ||||
|   window.popupContext = popupContext; | ||||
| } | ||||
| 
 | ||||
| popupContext = merge(popupContext, { | ||||
|   hasModal: false, | ||||
|   instances: {}, | ||||
|   modalStack: [] | ||||
| }; | ||||
| 
 | ||||
| if (Vue.prototype.$isServer) { | ||||
|   global.popupContext = popupContext; | ||||
| } else { | ||||
|   window.popupContext = popupContext; | ||||
| } | ||||
| }); | ||||
| 
 | ||||
| const getModal = function() { | ||||
|   let modalDom = PopupManager.modalDom; | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user