Skip to content

Commit 622a3d0

Browse files
committed
优化docs文档
1 parent 9d2268e commit 622a3d0

16 files changed

+53
-25
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# production
1212
/build
1313
/lib
14-
/dist
14+
dist
1515
/example/dist
1616

1717
# misc

docs/.vitepress/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ export default defineConfig({
99
// https://vitepress.dev/reference/default-theme-config
1010
nav: [
1111
{ text: 'Home', link: '/' },
12-
{ text: 'API', link: '/api/' },
1312
{ text: 'Guide', link: '/guide/' },
13+
{ text: 'API', link: '/api/' },
1414
{ text: 'Note', link: '/note/' },
1515
],
1616

docs/guide/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ import { CountService, LoggerService } from './service.ts';
5555
// 这行代码将CountService、LoggerService和当前组件进行了绑定
5656
declareProviders([CountService, LoggerService]);
5757
// 这行代码实例化了CountService得到一个countService对象
58+
// 并且countService对象自动注入了logger属性,是一个LoggerService实例对象
5859
const countService = useService(CountService);
5960
</script>
6061

docs/index.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ hero:
1515
link: /api/
1616

1717
features:
18-
- title: Feature A
19-
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
20-
- title: Feature B
21-
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
22-
- title: Feature C
23-
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
18+
- title: 深度 DI 集成​
19+
details: 无缝融合 Vue 3 的依赖注入机制,在组件、服务和模块间轻松注入、共享和管理状态,极大提升复杂应用架构的灵活性与可测试性。
20+
- title: 极致轻量化​
21+
details: 专注核心功能,gzip 压缩后仅 ​约 4kB​ 的超小体积,为你的项目带来强大的状态管理能力,却几乎不增加包负担。
22+
- title: 开箱即用的类型安全​
23+
details: 为 TypeScript 提供开箱即用的强力支持,精准的类型推导和验证贯穿状态访问与变更全过程,有效杜绝低级错误,提升开发效率和代码健壮性。
2424
---

docs/note/04.不同场景.md renamed to docs/note/01.不同场景.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# 不同场景
2+
13
## 场景
24

35
#### 场景 1:一个服务可以被多个组件绑定,一个组件也可以绑定多个服务

docs/note/01.父组件与子组件的理解.md renamed to docs/note/02.父组件与子组件的理解.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# 假设如下场景
1+
# 父组件与子组件的理解
2+
3+
## 假设如下场景
24

35
父组件是 ParentComp,绑定的服务是 ParentService。
46

docs/note/02.子组件获取父组件服务.md renamed to docs/note/03.子组件获取父组件服务.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# 假设如下场景
1+
# 子组件获取父组件服务
2+
3+
## 假设如下场景
24

35
父组件是 ParentComp,绑定的服务是 ParentService。
46

docs/note/03.父组件获取子组件服务.md renamed to docs/note/04.父组件获取子组件服务.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# 假设如下场景
1+
# 父组件获取子组件服务
2+
3+
## 假设如下场景
24

35
父组件是 ParentComp,绑定的服务是 ParentService。
46

@@ -70,7 +72,12 @@ function handleClickEvent() {
7072
场景 1:在服务中使用
7173

7274
```ts
73-
import { Inject, FIND_CHILD_SERVICE, Token, useService } from '@kaokei/use-vue-service';
75+
import {
76+
Inject,
77+
FIND_CHILD_SERVICE,
78+
Token,
79+
useService,
80+
} from '@kaokei/use-vue-service';
7481
const token = new Token<ChildServiceType>('child service name');
7582

7683
class DemoService {

docs/note/05.响应式方案.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# 响应式方案
2+
13
## 默认整体实例不是响应式,手动指定属性为响应式属性
24

35
可以使用 ref/shallowRef/reactive 等 API 将指定属性设置为响应式变量,这样在 vue 组件的 template 中就可以直接消费这些响应式属性。

docs/note/06.装饰器.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# 装饰器
2+
13
## @Computed 装饰器
24

35
[When "reactive" uses "class" and "computed", the "computed" attribute will not Reactive](https://github.com/vuejs/core/issues/1036)

0 commit comments

Comments
 (0)