Answers for "nuxt fetch does not set data"

1

nuxt fetch does not set data

import { Vue, Component } from 'nuxt-property-decorator'
  
export default class App extends Vue {
  something = ''
    
  // The problem is the context 
  async fetch({ params }: Context) {
    this.something = 'john doe'
  }
}

// This will work (without using the context)
export default class App extends Vue {
  something = ''
  
  async fetch() {
    this.something = 'john doe'
  }
}
Posted by: Guest on September-13-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language