reactive
- 示例
<template>
<div>
<button @click="increase">被点击了{{obj.count}}次</button>
</div>
</template>
import { createComponent, reactive } from '@vue/composition-api'
export default createComponent({
setup() {
const obj = reactive({ count: 0 })
const increase = () => {
obj.count++
return {
obj,
increase
}
}
})
</script>