interface HelloProps {
text: string
}
class Hello extends Component<HelloProps> {
count = 0
render() {
return <div>
{this.count}
{this.$props.text}
</div>
}
}
import { observable, effect } from 'vue'
const state = observable({
count: 0
})
effect(() => {
console.log(`count is: ${state.count}`)
}) // count is: 0
state.count++ // count is: 1