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

test: 补充 computed 自动推导类型示例

上级 1d6a604d
<template> <template>
<view class="page"> <view class="page">
<text id="count" class="uni-common-mb">count: {{ count }}</text> <text id="count" class="uni-common-mb">count: {{ count }}</text>
<text id="double-count" class="uni-common-mb">computed double count: {{ doubleCount }}</text> <text id="double-count" class="uni-common-mb">computed double count: {{ doubleCount }}</text>
<text id="obj-arr" class="uni-common-mb">obj.arr: {{ obj.arr }}</text> <text id="obj-arr" class="uni-common-mb">obj.arr: {{ obj.arr }}</text>
<text id="obj-arr-len" class="uni-common-mb">computed obj.arr.length: {{ objArrLen }}</text> <text id="obj-arr-len" class="uni-common-mb">computed obj.arr.length: {{ objArrLen }}</text>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<script setup> <script setup>
const count = ref(0) const count = ref(0)
const doubleCount = computed<number>(() : number => { const doubleCount = computed(() : number => {
return count.value * 2 return count.value * 2
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册