nuxt-community / nuxt-property-decorator

Property decorators for Nuxt (base on vue-property-decorator)
https://github.com/kaorun343/vue-property-decorator
MIT License
399 stars 34 forks source link

How i can use computed? #94

Closed huuhait closed 3 years ago

huuhait commented 3 years ago

Hi i've problem about computed...

danielroe commented 3 years ago

Like this:

@Component
export default class HelloWorld extends Vue {
  firstName = 'John'
  lastName = 'Doe'

  // Declared as computed property getter
  get name() {
    return this.firstName + ' ' + this.lastName
  }

More info and examples here.