0👍
You should change the arrow function data: () => {
to data() {
According to the documentation:
Note that you should not use an arrow function with the data property (e.g. data: () => { return { a: this.myProp }}
). The reason is arrow functions bind the parent context, so this will not be the Vue instance as you expect and this.myProp
will be undefined.
- [Vuejs]-Vue.js Use a component within another on page via routes
- [Vuejs]-How can I display html code on vue template from html file
Source:stackexchange.com