-
Notifications
You must be signed in to change notification settings - Fork 432
Closed
vuejs/vue
#5514Description
Hi,
I just created a sample Vue/Typescript app using Toilal/vue-webpack-template. Everything is working great (compilation, lint, hot reload, etc.).
I defined a small popup component to test different features and I've hit a problem with the beforeDestroy hook. It does not get invoked.
Here is my code:
import Vue from 'vue'
import Component from 'vue-class-component'
import WithRender from './Popup.html?style=./Popup.css'
@WithRender
@Component
export default class Popup extends Vue {
...
mounted() {
console.info('mounted')
window.addEventListener('keyup', this.onKeyup)
}
beforeDestroy() {
console.info('beforeDestroy')
window.removeEventListener('keyup', this.onKeyup)
}
}The mounted hook is getting invoked. I've tried the same approach with the standard webpack template and it worked.
I'm using the latest versions :
"vue": "^2.2.6",
"vue-class-component": "^5.0.1",
"vue-router": "^2.4.0"
Thanks for your help.
Metadata
Metadata
Assignees
Labels
No labels