(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);
}
},
destroyed() {
if (process.client) {
document.removeEventListener('click', this.documentClicked);
}
unmounted() {
document.removeEventListener('click', this.documentClicked);
},
methods: {
getDayClass(d: Day): string {

View File

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

View File

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

View File

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

View File

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