Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ruojianll committed Apr 19, 2024
1 parent 573280d commit ca50670
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 2 deletions.
4 changes: 3 additions & 1 deletion docs/en/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@
- Migration
- [Migrate from v2 to v3](/en/migration/from-v2-to-v3.md)
- Stage3 decorators
- [Stage3 decorators](/en/stage3-decorators/stage3-decorators.md)
- [Stage3 decorators](/en/stage3-decorators/stage3-decorators.md)
- Wellknown issues
- [Wellknown issues](/en/wellknown-issues/wellknown-issues.md)
11 changes: 11 additions & 0 deletions docs/en/wellknown-issues/do-not-use-this.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Component, Vue, Prop } from 'vue-facing-decorator'
@Component
class Comp extends Vue {
@Prop
prop!: number

method() { return '' }

field1 = this.prop //NOT SUPPORT
field2 = this.method()//NOT SUPPORT
}
16 changes: 16 additions & 0 deletions docs/en/wellknown-issues/wellknown-issues.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Don't use `this` context while declaring class fields

When `useDefineForClassFields` is `true` in ts config, we can't access fields on `this` context while declaring class fields.

[](./do-not-use-this.ts ':include :type=code typescript')

## Use Vitest

If you have some error when use v-f-d with test framework, use Vitest instead of it.

https://github.com/facing-dev/vue-facing-decorator/issues/54#issuecomment-1500019388
https://github.com/facing-dev/vue-facing-decorator/issues/33#issuecomment-1410648544

## Lake of IDE type supports

We can't provide full IDE type support at the moment. It's recommended to use tsx as render to have type supports as more as we can do. It will be kept improving in the future.
4 changes: 3 additions & 1 deletion docs/zh-cn/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@
- 从旧版迁移
- [v2迁移到v3](/zh-cn/migration/from-v2-to-v3.md)
- Stage3装饰器
- [Stage3装饰器](/zh-cn/stage3-decorators/stage3-decorators.md)
- [Stage3装饰器](/zh-cn/stage3-decorators/stage3-decorators.md)
- 常见问题
- [常见问题](/zh-cn/wellknown-issues/wellknown-issues.md)
16 changes: 16 additions & 0 deletions docs/zh-cn/wellknown-issues/wellknown-issues.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## 声明类组件属性时不要使用`this`上下文

当TS配置文件中`useDefineForClassFields``true`时,我们不能用`this`上下文来声明类组件的属性。

[](../../en/wellknown-issues/do-not-use-this.ts ':include :type=code typescript')

## 使用Vitest

如果你在使用测试框架出现错误时,尝试使用Vitest。

https://github.com/facing-dev/vue-facing-decorator/issues/54#issuecomment-1500019388
https://github.com/facing-dev/vue-facing-decorator/issues/33#issuecomment-1410648544

## 缺少IDE类型是吃

目前我们不能为IDE提供完整的类型支持。如果你需要目前尽可能多的类型支持,建议使用TSX作为渲染器。我们会持续加强类型支持。
4 changes: 4 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ Welcome to suggest and contribute.

Document languages: English, 简体中文, Portuguese

# Wellknown issues

https://facing-dev.github.io/vue-facing-decorator/#/en/wellknown-issues/wellknown-issues

# Discussion

To discord [https://discord.gg/4exxtFgkcz](https://discord.gg/4exxtFgkcz)
Expand Down

0 comments on commit ca50670

Please sign in to comment.