Closed
Description
example github repository: https://github.com/kerolloz/vue-class-component-bug
[Vue warn]: Error in data(): "TypeError: this._routerRoot is undefined"
<template>
<div>
<h1>{{ title }}</h1>
<p>Path: {{ currentPath }}</p>
</div>
</template>
<script lang="ts">
import Vue from "vue";
import Component from "vue-class-component";
@Component
export default class HelloWorld extends Vue {
// data() {
// return {
// title: "Bug",
// currentPath: this.$route.path,
// };
// }
title = "Bug";
currentPath = this.$route.path;
}
</script>