Are Vue 3 facing decorator properties reactive?

114 views Asked by At

this is my sample vue code

 <script lang="ts">
import { Component, Vue, toNative,Prop,Inject,Watch,Provide } from 'vue-facing-decorator'

@Component
class Demo extends Vue {
    title="Demo Page"
    clickedbtn=()=>{
     this.title.value="Demo clicked"
    }
}
export default toNative(Demo)
</script>


<template>
<h2>{{ title }}</h2>
<button v-on:click="clickedbtn">button</button>
</template>

when I used this code, this title won't change when click the button. but when using that title variable with the ref keyword it is changing. then do we need to use the ref keyword in order to get the reactivity with the vue class type component?

0

There are 0 answers