Skip to content

Commit de46d66

Browse files
committed
refactor: update docs
1 parent 4153f51 commit de46d66

7 files changed

Lines changed: 49 additions & 17 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<span text-yellow-600 dark:text-yellow text-xs border p-1 rounded>
3+
⚠️ <slot />
4+
</span>
5+
</template>

docs/.vitepress/theme/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import { h } from 'vue'
22
import Theme from 'vitepress/theme'
33
import HomePage from '../components/HomePage.vue'
4+
import WarnBadge from '../components/WarnBadge.vue'
45
import CodeGroup from './components/CodeGroup.vue'
5-
import CodeGroupItemVue from './components/CodeGroupItem.vue'
6-
import type { EnhanceAppContext } from 'vitepress'
6+
import CodeGroupItem from './components/CodeGroupItem.vue'
77
import 'uno.css'
88
import './style.css'
99

10+
import type { EnhanceAppContext } from 'vitepress'
11+
1012
export default {
1113
...Theme,
1214
Layout() {
@@ -16,6 +18,7 @@ export default {
1618
},
1719
enhanceApp({ app }: EnhanceAppContext) {
1820
app.component('CodeGroup', CodeGroup)
19-
app.component('CodeGroupItem', CodeGroupItemVue)
21+
app.component('CodeGroupItem', CodeGroupItem)
22+
app.component('WarnBadge', WarnBadge)
2023
},
2124
}

docs/guide/getting-started.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Getting Started
22

3+
## Requirements
4+
5+
- Developers who are familiar with Vue.
6+
- Vue 2.7 or Vue >= 3.0.
7+
- Some features need Vue >= 3.2.25.
8+
- VSCode with Volar.
9+
- ❌ WebStorm is not supported.
10+
311
## Bundler integrations
412

513
### Installation
@@ -120,6 +128,10 @@ module.exports = {
120128

121129
## TypeScript Support
122130

131+
:::: code-group
132+
133+
::: code-group-item Vue 3
134+
123135
```json
124136
// tsconfig.json
125137
{
@@ -130,6 +142,24 @@ module.exports = {
130142
}
131143
```
132144

145+
:::
146+
147+
::: code-group-item Vue 2
148+
149+
```json
150+
// tsconfig.json
151+
{
152+
"compilerOptions": {
153+
// ...
154+
"types": ["unplugin-vue-macros/vue2-macros-global" /* ... */]
155+
}
156+
}
157+
```
158+
159+
:::
160+
161+
::::
162+
133163
## Volar Support
134164

135165
For detailed configuration, please refer to the description of the specific macro.
@@ -152,6 +182,6 @@ npm i -D @vue-macros/volar
152182
}
153183
```
154184

155-
:tada: Congratulations! You have successfully set up unplugin-vue-macros.
185+
:tada: Congratulations! You have successfully set up `unplugin-vue-macros`.
156186

157187
To learn more about the macros, please visit [All Macros](/macros/) :laughing:.

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ features:
2020
details: Explore and extend more macros and syntax sugar to Vue.
2121
- icon: 💚
2222
title: Out-of-the-box and good compatibility
23-
details: Supports both Vue 2 and Vue 3 out-of-the-box.
23+
details: Supports both Vue 2.7 and Vue 3 out-of-the-box.
2424
- icon: 🦾
2525
title: Type Safe
2626
details: Full TypeScript and Volar support.

docs/macros/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ Please make sure `unplugin-vue-macros` is set up correctly. If you haven't yet,
1010
- [shortEmits](/macros/short-emits)
1111
- [shortVmodel](/macros/short-vmodel)
1212
- [hoistStatic](/macros/hoist-static)
13-
- [setupComponent](/macros/setup-component) <span text-yellow-600 dark:text-yellow text-xs border p-1 rounded>:warning: Experimental</span>
14-
- [setupSFC](/macros/setup-sfc) <span text-yellow-600 dark:text-yellow text-xs border p-1 rounded>:warning: Experimental</span>
13+
- [setupComponent](/macros/setup-component) <WarnBadge>Experimental</WarnBadge>
14+
- [setupSFC](/macros/setup-sfc) <WarnBadge>Experimental</WarnBadge>

docs/macros/setup-component.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# setupComponent
1+
# setupComponent <WarnBadge>Experimental, use at your risk</WarnBadge>
22

3-
::: warning
3+
::: tip
44

5-
Under experimental, use at your risk!
5+
If you're using `setupComponent`, then `defineRender` cannot be disabled.
66

77
:::
88

docs/macros/setup-sfc.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
# setupSFC
2-
3-
::: warning
4-
5-
Under experimental, use at your risk!
6-
7-
:::
1+
# setupSFC <WarnBadge>Experimental, use at your risk</WarnBadge>
82

93
::: tip
104

0 commit comments

Comments
 (0)