Y
Y
yativ_sobb2017-11-04 17:45:07
JavaScript
yativ_sobb, 2017-11-04 17:45:07

Vue-typescript-component not working reactivity?

Why doesn't the template change when the method is used?

<template>
  {{count}}
</template>

When I do this, the change occurs in the template
export default{
 data():Object{
   return {
     count: 0
   }
 },
  methods: {
     plus():void{
        this.count++
     }
 }
}

And through the Vue-typescript-componen classes, changes in the template do not work
export default class Aaa extends Vue{


     count :number= 0


     plus():void{
        this.count++
     }
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question