提交 b24e757c 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

refactor(composition api): triggerRef 优化类型

上级 77c0ab89
<template>
<view class="page">
<text id="state-count" class="uni-common-mb">state.count: {{ state['count'] }}</text>
<text id="state-count" class="uni-common-mb">state.count: {{ state.count }}</text>
<button id="increment-state-count-btn" class="uni-common-mb" @click="incrementStateCount">increment
state.count</button>
<button id="trigger-ref-state-btn" @click="triggerRefState">trigger state</button>
</view>
</template>
<script setup>
<script setup>
type State = {
count: number
}
const state = shallowRef({
count: 0
})
} as State)
const incrementStateCount = () => {
state.value.count++
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册