Description
Describe the bug
I'm usingnuxt-property-decorator
and vue-property-decorator
to import elements such Vue, Component, Model, ect into my project. I chose to develop usingClass-Based Component
.
Inside a page (Home), I created a method that allows to perform an operation followed by a page refresh using this.$nuxt.refresh()
I manage to refresh the page, however I have a warning that tells me that my instruction is not recognized.
`Property '$nuxt' does not exist on type 'Home'.
I exactly followed what is here : https://typescript.nuxtjs.org/guide/setup to install my Nuxt project with TS. The problem remains the same.
To Reproduce
PS: the code has been clipped to keep the important part
<script lang="ts">
import { Component, Vue } from 'nuxt-property-decorator'
import { manager } from '../services/manager'
@Component({})
export default class Home extends Vue {
services!: Array
async asyncData() {
const services = await manger.get()
return { services }
}
....
/**
* Change results order
* @param value {string}
* @returns {void}
*/
refreshResults(value: string): void {
// Setting the new ranking value
manager.setSettings(`${value}(name)`)
// refreshing page
this.$nuxt.refresh()
}
}
Expected behavior
this.$nuxt.refresh()
to be recognized
Screenshots
https://i.stack.imgur.com/c7nlJ.png