Answer the question
In order to leave comments, you need to log in
Cut the Vue component and paste it into the body of the site. What is fraught with?
Are there any consequences or possible errors for such code?
mounted() {
const el = this.$el.parentNode.removeChild(this.$el);
document.body.appendChild(el);
},
destroyed() {
document.body.removeChild(this.$el);
},
Answer the question
In order to leave comments, you need to log in
I did this for the moving panels, it will not cause any problems.
I got the following code for the panel itself or, in your case, the window
mounted() {
document.addEventListener('click', () => this.closePanel());
document.body.appendChild(this.$el);
document.body.style.overflow = "hidden";
setTimeout(() => this.isOpened = true, 100)
},
beforeDestroy() {
this.isOpened = false;
document.body.style.overflow = "auto";
},
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question