|
@ -15,21 +15,21 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script lang="ts"> |
|
|
<script lang="ts"> |
|
|
/* standard composition api */ |
|
|
|
|
|
import { ref } from 'vue' |
|
|
import { ref } from 'vue' |
|
|
export default { |
|
|
export default { |
|
|
props: { |
|
|
props: { |
|
|
msg: { type: String, required: true } |
|
|
msg: { type: String, required: true } |
|
|
}, |
|
|
}, |
|
|
|
|
|
/* standard composition api */ |
|
|
setup() { |
|
|
setup() { |
|
|
return { |
|
|
return { |
|
|
count: ref(0) |
|
|
|
|
|
|
|
|
count: ref(5) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
inc() { |
|
|
inc() { |
|
|
console.log('increment count') |
|
|
console.log('increment count') |
|
|
this.count++ // Rk: note how a ref value can be increment as any common value (ref is a proxy object!) |
|
|
|
|
|
|
|
|
this.count++ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|