Hi,
I’m using this code to navigate to another page but it doesn’t work because of TypeScript, it gives this error:
Property '$router' does not exist on type '{ openPage(p: object): void; }'.
Code:
<script lang="ts">
methods: {
openPage(p: object) {
this.$router.push(p.path)
}
}
If I remove …
lang="ts">
… it works fine. Is there a specific issue with TypeScript not detecting this as a feature of Vue?
Thank you.
2 posts - 2 participants