mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-09 04:31:35 +08:00
fix: overlay before destroy hook
This commit is contained in:
parent
0a0f7db1be
commit
8f9ecc211f
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "naive-ui",
|
||||
"version": "0.1.29",
|
||||
"version": "0.1.30",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
@ -40,9 +40,7 @@ export default {
|
||||
},
|
||||
beforeDestroy () {
|
||||
this.removeOverlay()
|
||||
console.log('removeContent', this.content)
|
||||
//
|
||||
this.app.removeChild(this.content)
|
||||
this.app.removeChild(this.$refs.content)
|
||||
},
|
||||
methods: {
|
||||
addOverlayToApp () {
|
||||
@ -50,13 +48,16 @@ export default {
|
||||
if (!overlay) {
|
||||
overlay = document.createElement('div')
|
||||
overlay.classList.add('n-modal-overlay')
|
||||
overlay.id = 'overlay'
|
||||
this.app.insertBefore(overlay, this.app.firstElementChild)
|
||||
}
|
||||
this.overlay = overlay
|
||||
}
|
||||
},
|
||||
removeOverlay () {
|
||||
if (this.overlay) {
|
||||
this.app.removeChild(this.overlay)
|
||||
let overlay = document.querySelector('#overlay')
|
||||
console.log(overlay)
|
||||
if (overlay) {
|
||||
this.app.removeChild(overlay)
|
||||
}
|
||||
},
|
||||
detachContentToApp () {
|
||||
|
Loading…
Reference in New Issue
Block a user