From 5b43e5428a071b880069281348d3011f94323138 Mon Sep 17 00:00:00 2001 From: lvzl <627417163@qq.com> Date: Tue, 3 Sep 2024 16:08:34 +0800 Subject: [PATCH 1/2] revert: TCustomInstanceProperty --- types/wx/lib.wx.component.d.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/types/wx/lib.wx.component.d.ts b/types/wx/lib.wx.component.d.ts index 321841a..57dfbf5 100644 --- a/types/wx/lib.wx.component.d.ts +++ b/types/wx/lib.wx.component.d.ts @@ -56,8 +56,6 @@ declare namespace WechatMiniprogram.Component { Partial> & Partial & Partial & - // 有很大几率会在 this.xxx 上使用一些暂存的变量,应该像Page一样支持传入自定义属性 - Partial & ThisType< Instance< TData, From b9aacb6106be2761e755d3e37e48e9a6b1ab87d3 Mon Sep 17 00:00:00 2001 From: lvzl <627417163@qq.com> Date: Tue, 3 Sep 2024 16:08:58 +0800 Subject: [PATCH 2/2] revert: TCustomInstanceProperty --- test/component.test.ts | 11 +++++++++++ test/issue.test.ts | 2 -- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/test/component.test.ts b/test/component.test.ts index 7317097..de6fa11 100644 --- a/test/component.test.ts +++ b/test/component.test.ts @@ -120,6 +120,17 @@ Component({ }, }) +expectError( + Component({ + custom: 1, + methods: { + f() { + this.custom + }, + }, + }), +) + interface Config { a: number } diff --git a/test/issue.test.ts b/test/issue.test.ts index f218a77..0dfd294 100644 --- a/test/issue.test.ts +++ b/test/issue.test.ts @@ -464,7 +464,6 @@ import WX = WechatMiniprogram } Component({ - _timer: '', properties: { bar: { type: Object, @@ -483,7 +482,6 @@ import WX = WechatMiniprogram test() { expectType(this.data.bar) expectType(this.getData()) - expectType(this._timer) }, } })