Skip to content

Commit 4c55bca

Browse files
committed
docs
1 parent a1c93de commit 4c55bca

File tree

4 files changed

+27
-1
lines changed

4 files changed

+27
-1
lines changed

docs/en/custom/code-usage.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ function Log(prefix: string) {
99
options.methods[key] = function (...args: any[]) {
1010
old.apply(this, args)
1111
}
12+
}, {
13+
preserve: true
1214
})
1315
}
1416

docs/en/custom/custom.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,16 @@ If you are a package author, install vue-facing-decorator as `devDependecies` an
88
1. Generated vue options component, you can modify it to implement anything you want.
99
2. The key of class property(or method) which decorator decorated.
1010

11+
and an optional config object.
12+
1113
[](./code-usage.ts ':include :type=code typescript')
14+
15+
## Options
16+
17+
### `preserve`
18+
19+
Use this option to indicate whether the decorated value should be preserved before decorator applied or not.
20+
21+
[](./code-usage.ts ':include :type=code typescript')
22+
23+
If we set `preserve` to `false` in the above code, we can't access origin `method` in `methods`.

docs/zh-cn/custom/custom.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,16 @@
88
1. 生成的Vue options组件,你可以修改这个参数来实现你想实现的功能。
99
2. 装饰器所装饰的类属性(或方法)名。
1010

11+
和一个可选的配置对象。
12+
1113
[](../../en/custom/code-usage.ts ':include :type=code typescript')
14+
15+
## 选项
16+
17+
### `preserve`
18+
19+
使用这个选项来表示是否被装饰值要在装饰器起作用前被保留。
20+
21+
[](../../en/custom/code-usage.ts ':include :type=code typescript')
22+
23+
如果在上面代码中设置`preserve``false`, 我们将不能在`methods`访问`method`

docs/zh-cn/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* 支持 ES 类 继承、vue `extends` 和 vue `mixins`
1313
* [官方推荐](https://class-component.vuejs.org)
1414

15-
[](./quick-start/code-what-it-is-example.ts ':include :type=code typescript')
15+
[](../en/quick-start/code-what-it-is-example.ts ':include :type=code typescript')
1616

1717
如果你喜欢已经废弃的 [vue-class-component](https://github.com/vuejs/vue-class-component) 或 deprecaed [vue-property-decorator](https://github.com/kaorun343/vue-property-decorator), 那么请试试这个项目吧!
1818

0 commit comments

Comments
 (0)