-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
53 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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作为渲染器。我们会持续加强类型支持。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters