Skip to content

Commit e2e7d48

Browse files
committed
docs: add options & move hoistStatic
1 parent d536d02 commit e2e7d48

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

docs/.vitepress/configs/navs.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { DefaultTheme } from 'vitepress'
33
export const nav: DefaultTheme.NavItem[] = [
44
{ text: 'Guide', link: '/guide/getting-started' },
55
{ text: 'Macros', link: '/macros/' },
6+
{ text: 'Features', link: '/features/hoist-static' },
67
]
78

89
export const sidebar: DefaultTheme.Sidebar = [
@@ -42,10 +43,6 @@ export const sidebar: DefaultTheme.Sidebar = [
4243
text: 'shortVmodel',
4344
link: '/macros/short-vmodel',
4445
},
45-
{
46-
text: 'hoistStatic',
47-
link: '/macros/hoist-static',
48-
},
4946
{
5047
text: 'setupComponent',
5148
link: '/macros/setup-component',
@@ -56,4 +53,13 @@ export const sidebar: DefaultTheme.Sidebar = [
5653
},
5754
],
5855
},
56+
{
57+
text: 'Features',
58+
items: [
59+
{
60+
text: 'hoistStatic',
61+
link: '/features/hoist-static',
62+
},
63+
],
64+
},
5965
]
File renamed without changes.

docs/macros/define-model.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ VueMacros({
2525

2626
## Usage
2727

28+
Requires [`@vueuse/core`](https://www.npmjs.com/package/@vueuse/core), install it by yourself before using.
29+
2830
```vue
2931
<script setup lang="ts">
3032
const { modelValue, count } = defineModel<{
@@ -65,6 +67,8 @@ Assignment expression is only supported in `<script setup>` block. In other word
6567

6668
:::
6769

70+
[`@vueuse/core`](https://www.npmjs.com/package/@vueuse/core) is not required.
71+
6872
```vue{7-9}
6973
<script setup lang="ts">
7074
let { modelValue, count } = $defineModel<{
@@ -102,14 +106,19 @@ emit('update:count', count + 1)
102106

103107
## Volar Configuration
104108

105-
```jsonc{5}
109+
```jsonc{6,9-12}
106110
// tsconfig.json
107111
{
108112
"vueCompilerOptions": {
113+
"target": 3,
109114
"plugins": [
110115
"@vue-macros/volar/define-model"
111116
// ...more feature
112-
]
117+
],
118+
"defineModel": {
119+
// Only works when target is 2.7.
120+
"unified": true
121+
}
113122
}
114123
}
115124
```

0 commit comments

Comments
 (0)