Skip to content

Commit c4c5221

Browse files
committed
docs: auto-import-vite guide
1 parent b64d3c9 commit c4c5221

File tree

3 files changed

+76
-54
lines changed

3 files changed

+76
-54
lines changed
Lines changed: 3 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,5 @@
11
<template>
2-
<div class="badge">
3-
<a href="https://www.npmjs.com/package/vue-hooks-plus"
4-
><img src="https://img.shields.io/npm/v/vue-hooks-plus.svg" alt="npm package"
5-
/></a>
6-
<a href="https://github.com/InhiblabCore/vue-hooks-plus/actions/workflows/node-ci.yml"
7-
><img
8-
src="https://github.com/InhiblabCore/vue-hooks-plus/actions/workflows/ci.yml/badge.svg?branch=master"
9-
alt="build status"
10-
/></a>
11-
<a href="#badge"
12-
><img
13-
src="https://img.shields.io/github/languages/top/InhiblabCore/vue-hooks-plus"
14-
alt="language"
15-
/></a>
16-
<a
17-
href="https://img.badgesize.io/https:/unpkg.com/vue-hooks-plus/dist/js/index.es.js?label=gzip%20size&compression=gzip"
18-
><img
19-
src="https://img.badgesize.io/https:/unpkg.com/vue-hooks-plus/dist/js/index.es.js?label=gzip%20size&compression=gzip"
20-
alt="gzip"
21-
/></a>
22-
<a href="#badge"
23-
><img
24-
src="https://img.shields.io/librariesio/github/InhiblabCore/vue-hooks-plus"
25-
alt="librariesio"
26-
/></a>
27-
<a href="https://github.com/InhiblabCore/vue-hooks-plus/blob/master/LICENSE"
28-
><img src="https://img.shields.io/github/license/InhiblabCore/vue-hooks-plus" alt="LICENSE"
29-
/></a>
30-
</div>
2+
<a href="https://www.npmjs.com/package/vue-hooks-plus"
3+
><img src="https://img.shields.io/npm/v/vue-hooks-plus.svg" alt="npm package"
4+
/></a>
315
</template>
32-
33-
<script lang="ts" setup></script>
34-
35-
<style scoped lang="less">
36-
.badge {
37-
display: flex;
38-
justify-content: center;
39-
40-
& > a {
41-
margin-left: 6px;
42-
margin-right: 6px;
43-
}
44-
}
45-
</style>

packages/hooks/docs/guide/index.en-US.md

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@ source:
55

66
<script setup>
77
import Badge from '@theme/home/Badge.vue'
8-
import Icon from '@theme/home/Icon.vue'
98
</script>
109

11-
<Icon />
12-
<h1 style="text-align:center">VueHooks Plus</h1>
13-
<br />
14-
<Badge />
10+
# VueHooks Plus
11+
12+
Through this chapter, you will know how to quickly start using VueHooks Plus.
1513

1614
## ✨ Features
1715

@@ -26,6 +24,10 @@ import Icon from '@theme/home/Icon.vue'
2624
- 🤺 Playground, there's ample scope for one's abilities
2725
- 🔐 Perfect test, safe and reliable
2826

27+
## 📝 Latest Version
28+
29+
<Badge />
30+
2931
## 📦 Install
3032

3133
```bash
@@ -46,8 +48,37 @@ import { useRequest } from 'vue-hooks-plus'
4648
import useRequest from 'vue-hooks-plus/es/useRequest'
4749
```
4850

51+
### Auto Import
52+
53+
Only `resolver` for `unplugin-auto-import/vite`.
54+
55+
#### Vite
56+
57+
```bash
58+
59+
npm i @vue-hooks-plus/resolvers
60+
61+
```
62+
63+
##### Use
64+
65+
```typescript
66+
import AutoImport from 'unplugin-auto-import/vite'
67+
import { VueHooksPlusResolver } from '@vue-hooks-plus/resolvers'
68+
69+
export const AutoImportDeps = () =>
70+
AutoImport({
71+
imports: ['vue', 'vue-router'],
72+
include: [/\.[tj]sx?$/, /\.vue$/, /\.vue\?vue/, /\.md$/],
73+
dts: 'src/auto-imports.d.ts',
74+
resolvers: [VueHooksPlusResolver()],
75+
})
76+
```
77+
4978
<br />
5079

51-
::: warning does not contain vue2
80+
## 🧩 Compatible
81+
82+
::: warning Not compatible with vue2 version
5283

5384
:::

packages/hooks/docs/guide/index.zh-CN.md

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@ source:
55

66
<script setup>
77
import Badge from '@theme/home/Badge.vue'
8-
import Icon from '@theme/home/Icon.vue'
98
</script>
109

11-
<Icon />
12-
<h1 style="text-align:center">VueHooks Plus</h1>
13-
<br />
14-
<Badge />
10+
# VueHooks Plus
11+
12+
通过该章节,你将了解到如何快速开始使用 VueHooks Plus。
1513

1614
## ✨ 特性
1715

@@ -26,6 +24,10 @@ import Icon from '@theme/home/Icon.vue'
2624
- 🤺 演练场,大有用武之地
2725
- 🔐 测试完善,安全可靠
2826

27+
## 📝 最新版本
28+
29+
<Badge />
30+
2931
## 📦 安装
3032

3133
```bash
@@ -46,8 +48,37 @@ import { useRequest } from 'vue-hooks-plus'
4648
import useRequest from 'vue-hooks-plus/es/useRequest'
4749
```
4850

51+
### 自动引入
52+
53+
目前只有 `unplugin-auto-import/vite` 下的 `resolver`
54+
55+
#### Vite
56+
57+
```bash
58+
59+
npm i @vue-hooks-plus/resolvers
60+
61+
```
62+
63+
##### 使用
64+
65+
```typescript
66+
import AutoImport from 'unplugin-auto-import/vite'
67+
import { VueHooksPlusResolver } from '@vue-hooks-plus/resolvers'
68+
69+
export const AutoImportDeps = () =>
70+
AutoImport({
71+
imports: ['vue', 'vue-router'],
72+
include: [/\.[tj]sx?$/, /\.vue$/, /\.vue\?vue/, /\.md$/],
73+
dts: 'src/auto-imports.d.ts',
74+
resolvers: [VueHooksPlusResolver()],
75+
})
76+
```
77+
4978
<br />
5079

80+
## 🧩 兼容
81+
5182
::: warning 不兼容 vue2 版本
5283

5384
:::

0 commit comments

Comments
 (0)