Skip to content

Commit 2957b20

Browse files
committed
1 parent 3ac427c commit 2957b20

File tree

19 files changed

+84
-73
lines changed

19 files changed

+84
-73
lines changed

docs/en/_sidebar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
- [Component](/en/class-component/component/component.md)
55
- [Property](/en/class-component/property/property.md)
66
- [Method](/en/class-component/method/method.md)
7-
- [Lifecycle hooks](/en/class-component/lifecycle-hook/lifecycle-hook.md)
7+
- [Hooks](/en/class-component/hooks/hooks.md)
88
- [Component property](/en/class-component/component-property/component-property.md)
99
- [Accessor](/en/class-component/accessor/accessor.md)
1010
- [Event](/en/class-component/event/event.md)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
import { Component, Vue, Hook } from 'vue-facing-decorator'
3+
4+
/*
5+
Vue options API
6+
{
7+
myHook(){},
8+
}
9+
*/
10+
11+
@Component
12+
export default class MyComponent extends Vue {
13+
@Hook
14+
myHook() { }
15+
}

docs/en/class-component/lifecycle-hook/lifecycle-hook.md renamed to docs/en/class-component/hooks/hooks.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ Class component supports almost all lifecycle hooks in vanilla vue. Write them a
66
77
[](./code-usage.ts ':include :type=code typescript')
88

9-
## Lsit of lifecycle hook names
9+
10+
11+
## Internal hook names list
1012

1113
```javascript
1214
[
@@ -32,7 +34,7 @@ Class component supports almost all lifecycle hooks in vanilla vue. Write them a
3234

3335
## For other names
3436

35-
If your hook names aren't in the above list. You could use `options` or `modifier` in `Component` decorator.
37+
If your hook names aren't in the above list. You could use decorator `Hook`.
3638

3739
> e.g. Hooks from `vue-router`.
3840

docs/en/class-component/lifecycle-hook/code-for-other-names.ts

Lines changed: 0 additions & 22 deletions
This file was deleted.

docs/zh-cn/_sidebar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
- [组件](/zh-cn/class-component/component/component.md)
55
- [属性](/zh-cn/class-component/property/property.md)
66
- [方法](/zh-cn/class-component/method/method.md)
7-
- [生命周期钩子](/zh-cn/class-component/lifecycle-hook/lifecycle-hook.md)
7+
- [钩子](/zh-cn/class-component/hooks/hooks.md)
88
- [组件属性](/zh-cn/class-component/component-property/component-property.md)
99
- [存取器](/zh-cn/class-component/accessor/accessor.md)
1010
- [事件](/zh-cn/class-component/event/event.md)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
import { Component, Vue, Hook } from 'vue-facing-decorator'
3+
4+
/*
5+
Vue options API
6+
{
7+
myHook(){},
8+
}
9+
*/
10+
11+
@Component
12+
export default class MyComponent extends Vue {
13+
@Hook
14+
myHook() { }
15+
}

docs/zh-cn/class-component/lifecycle-hook/lifecycle-hook.md renamed to docs/zh-cn/class-component/hooks/hooks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
[](./code-usage.ts ':include :type=code typescript')
88

9-
## 钩子名称列表
9+
## 内部钩子名称列表
1010

1111
```javascript
1212
[
@@ -32,7 +32,7 @@
3232

3333
## 其他钩子名称
3434

35-
如果你的钩子名称不再上面的列表中,你可以使用装饰器`Component``options``modifier`选项
35+
如果你的钩子名称不再上面的列表中,你可以使用装饰器`Hook`
3636

3737
> 例如`vue-router`中的钩子。
3838

docs/zh-cn/class-component/lifecycle-hook/code-for-other-names.ts

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)