Skip to content

Commit 101d557

Browse files
authored
docs: clarify example and match computed definition to function (#376)
* docs: clarify example and match computed definition to function * fix: update variable name
1 parent 1d9fa0c commit 101d557

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/guide/typescript-support.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,14 +253,14 @@ Computed values will automatically infer the type from returned value
253253
import { defineComponent, ref, computed } from 'vue'
254254

255255
export default defineComponent({
256-
name: 'HelloWorld',
256+
name: 'CounterButton',
257257
setup() {
258258
let count = ref(0)
259259

260260
// read-only
261-
const double = computed(() => count.value)
261+
const doubleCount = computed(() => count.value * 2)
262262

263-
const result = double.value.split('') // => Property 'split' does not exist on type 'number'
263+
const result = doubleCount.value.split('') // => Property 'split' does not exist on type 'number'
264264
}
265265
})
266266
```

0 commit comments

Comments
 (0)