Skip to content

Commit 01dfbdd

Browse files
committed
docs
1 parent e765021 commit 01dfbdd

16 files changed

+84
-9
lines changed

docs/en/_sidebar.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,6 @@
1818
- [Complex example](/en/inheritance/complex-example/complex-example.md)
1919
- TSX
2020
- [TSX render](/en/tsx/tsx-render/tsx-render.md)
21-
- [Attribute types](/en/tsx/attribute-types/attribute-types.md)
21+
- [Attribute types](/en/tsx/attribute-types/attribute-types.md)
22+
- Compatibility
23+
- [reflect-metadata](/en/compatibility/reflect-metadata/reflect-metadata.md)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import {Component} from 'vue-facing-decorator/dist/index-return-cons'
2+
3+
@Component
4+
export default class MyComp{
5+
6+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
//...
3+
chainWebpack: config => {
4+
//...
5+
config.resolve.alias.set('vue-facing-decorator', 'vue-facing-decorator/dist/index-return-cons')
6+
}
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
//...
3+
resolve: {
4+
//...
5+
'vue-facing-decorator': 'vue-facing-decorator/dist/index-return-cons'
6+
}
7+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## Usage
2+
3+
To work with `reflect-metadata`, we should use `vue-facing-decorator/dist/index-return-cons` instead of `vue-facing-decorator` in code.
4+
5+
[](./code-usage.ts ':include :type=code typescript')
6+
7+
## Webpack `alias`
8+
9+
In `webpack.config.js`.
10+
11+
[](./code-webpack-alias-webpack-config.js ':include :type=code typescript')
12+
13+
Or in `vue.config.js`.
14+
15+
[](./code-webpack-alias-vue-config.js ':include :type=code typescript')

docs/en/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Works on TypeScript and decorator.
99
* Community desired vue class component with typescript decorators.
1010
* Safety. Transform es class to vue options api according to specifications.
1111
* Performance. Once transform on project loading, ready for everywhere.
12-
* Support es class inherit, vue `extends` and vue `mixins`.
12+
* Support ES class inherit, vue `extends` and vue `mixins`.
1313

1414
[](./quick-start/code-what-it-is-example.ts ':include :type=code typescript')
1515

docs/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Works on TypeScript and decorator.
99
* Community desired vue class component with typescript decorators.
1010
* Safety. Transform es class to vue options api according to specifications.
1111
* Performance. Once transform on project loading, ready for everywhere.
12-
* Support es class inherit, vue `extends` and vue `mixins`.
12+
* Support ES class inherit, vue `extends` and vue `mixins`.
1313

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

docs/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"declarationMap": true,
2424
"noUnusedLocals": false,
2525
"paths": {
26-
"vue-facing-decorator": ["../dist"]
26+
"vue-facing-decorator": ["../dist"],
27+
"vue-facing-decorator/dist/index-return-cons": ["../dist/index-return-cons"]
2728
},
2829
"jsx": "preserve"
2930
},

docs/zh-cn/_sidebar.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,6 @@
1818
- [复杂示例](/zh-cn/inheritance/complex-example/complex-example.md)
1919
- TSX
2020
- [TSX](/zh-cn/tsx/tsx-render/tsx-render.md)
21-
- [属性类型](/zh-cn/tsx/attribute-types/attribute-types.md)
21+
- [属性类型](/zh-cn/tsx/attribute-types/attribute-types.md)
22+
- 兼容性
23+
- [reflect-metadata](/zh-cn/compatibility/reflect-metadata/reflect-metadata.md)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import {Component} from 'vue-facing-decorator/dist/index-return-cons'
2+
3+
@Component
4+
export default class MyComp{
5+
6+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
//...
3+
chainWebpack: config => {
4+
//...
5+
config.resolve.alias.set('vue-facing-decorator', 'vue-facing-decorator/dist/index-return-cons')
6+
}
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
//...
3+
resolve: {
4+
//...
5+
'vue-facing-decorator': 'vue-facing-decorator/dist/index-return-cons'
6+
}
7+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## Usage
2+
3+
如果和`reflect-metadata`一起使用, 我们需要在代码中用`vue-facing-decorator/dist/index-return-cons`替换`vue-facing-decorator`
4+
5+
[](./code-usage.ts ':include :type=code typescript')
6+
7+
## Webpack `alias`
8+
9+
使用`webpack.config.js`
10+
11+
[](./code-webpack-alias-webpack-config.js ':include :type=code typescript')
12+
13+
或使用`vue.config.js`
14+
15+
[](./code-webpack-alias-vue-config.js ':include :type=code typescript')

docs/zh-cn/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* 通过类的方式来写vue组件。
1010
* 稳定、安全,根据vue规范将es 类转换成vue option api。
1111
* 高性能,项目加载时转换一次,随处可用。
12-
* 支持 es 类 继承、vue `extends` 和 vue `mixins`
12+
* 支持 ES 类 继承、vue `extends` 和 vue `mixins`
1313

1414
[](./quick-start/code-what-it-is-example.ts ':include :type=code typescript')
1515

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-facing-decorator",
3-
"version": "2.1.9",
3+
"version": "2.1.10",
44
"description": "Vue typescript class and decorator based component.",
55
"main": "dist/index.js",
66
"keywords": [

src/index-return-cons.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export * from './index'
22
import { Component as ComponentOld } from './index'
3-
export function Component(this: any) {
4-
const res = ComponentOld.apply(this, arguments as any)
3+
export function Component(this: any,...args:Parameters<typeof ComponentOld>) {
4+
const res = ComponentOld.apply(this, args)
55
function process(res: any) {
66
const cons = res.__vfdConstructor
77

0 commit comments

Comments
 (0)