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