Skip to content

Commit 9b25475

Browse files
committed
More docs
1 parent 10c5810 commit 9b25475

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

docs/interpolation.md

+24-1
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,27 @@ Completion:
3636

3737
- Collects information from `<script>` region by traversing its AST
3838
- Offer `props`, `data` and `methods` in interpolation regions
39-
- Offer `:prop` completion on child components
39+
- Offer `:prop` completion on child components
40+
41+
## Type Checking with JSDocs
42+
43+
You don't have to use `lang="ts"` for typing functions. This would show error that `'foo'` is not assignable to `number`
44+
45+
```vue
46+
<template>
47+
<div>{{ numOnly('foo') }}</div>
48+
</template>
49+
50+
<script>
51+
export default {
52+
methods: {
53+
/**
54+
* @param {number} num
55+
*/
56+
numOnly(num) {
57+
58+
}
59+
}
60+
}
61+
</script>
62+
```

0 commit comments

Comments
 (0)