vuepress
vuepress copied to clipboard
beforeDestroy for dynamic component hook lose direct access to this data/props
- [X ] I confirm that this is an issue rather than a question.
Bug report
beforeDestroy lifecycle hook are not able to access props and data normally using "this".
Steps to reproduce
Add a beforeDestroy lifecycle hook to a dynamic Vue component with props+data in Vuepress.
Set breakpoint and navigate away. beforeDestroy will be called but the props+data no longer available directly using "this". They can however be found using this.$data and this.$props
What is expected?
props + data should be available using "this" just as it is when hooking into mounted()
What is actually happening?
Not directly available unless one look under $data and $props.
Other relevant information
Also, an instance variable imported on top of the script is also undefined in beforeDestroy..... Maybe beforeDestroy is called to late after things are in fact destroyed ?
- Output of
npx vuepress infoin my VuePress project:
Environment Info:
System: OS: macOS Mojave 10.14.6 CPU: (8) x64 Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz Binaries: Node: 12.13.0 - /usr/local/bin/node Yarn: Not Found npm: 6.12.0 - /usr/local/bin/npm Browsers: Chrome: 83.0.4103.116 Edge: Not Found Firefox: 78.0.1 Safari: 13.1.1 npmPackages: @vuepress/core: 1.5.2 @vuepress/theme-default: 1.5.2 vuepress: 1.5.2 => 1.5.2 npmGlobalPackages: vuepress: Not Found