(vue) rename destroyed to unmounted and beforeDestroy to beforeUnmount

https://v3-migration.vuejs.org/breaking-changes/#other-minor-changes
This commit is contained in:
Valentyne Stigloher 2024-04-26 18:57:31 +02:00
parent 348402b4a6
commit d7ead48168
5 changed files with 10 additions and 18 deletions

View File

@ -81,10 +81,8 @@ export default Vue.extend({
document.addEventListener('click', this.documentClicked); document.addEventListener('click', this.documentClicked);
} }
}, },
destroyed() { unmounted() {
if (process.client) {
document.removeEventListener('click', this.documentClicked); document.removeEventListener('click', this.documentClicked);
}
}, },
methods: { methods: {
getDayClass(d: Day): string { getDayClass(d: Day): string {

View File

@ -35,10 +35,8 @@ export default {
document.addEventListener('click', this.documentClicked); document.addEventListener('click', this.documentClicked);
} }
}, },
destroyed() { unmounted() {
if (process.client) {
document.removeEventListener('click', this.documentClicked); document.removeEventListener('click', this.documentClicked);
}
}, },
methods: { methods: {
documentClicked() { documentClicked() {

View File

@ -443,11 +443,9 @@ export default {
window.addEventListener('scroll', this.updateShown); window.addEventListener('scroll', this.updateShown);
} }
}, },
destroyed() { unmounted() {
if (process.client) {
document.removeEventListener('click', this.documentClicked); document.removeEventListener('click', this.documentClicked);
document.removeEventListener('scroll', this.updateShown); document.removeEventListener('scroll', this.updateShown);
}
}, },
methods: { methods: {
isActiveRoute(link) { isActiveRoute(link) {

View File

@ -108,7 +108,7 @@ export default Vue.extend({
}; };
}, },
}, },
beforeDestroy() { beforeUnmount() {
this.hide(); this.hide();
}, },
methods: { methods: {

View File

@ -26,10 +26,8 @@ export default {
window.addEventListener('scroll', this.updateShown); window.addEventListener('scroll', this.updateShown);
} }
}, },
destroyed() { unmounted() {
if (process.client) {
document.removeEventListener('scroll', this.updateShown); document.removeEventListener('scroll', this.updateShown);
}
}, },
methods: { methods: {
scroll() { scroll() {