Skip to content

Commit

Permalink
Merge branch 'master' into behavior-ts-support
Browse files Browse the repository at this point in the history
  • Loading branch information
lv-z-l committed Sep 3, 2024
2 parents 14bb344 + b9aacb6 commit 3a100d0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
11 changes: 11 additions & 0 deletions test/component.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,17 @@ Component({
},
})

expectError(
Component({
custom: 1,
methods: {
f() {
this.custom
},
},
}),
)

interface Config {
a: number
}
Expand Down
2 changes: 0 additions & 2 deletions test/issue.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,6 @@ import WX = WechatMiniprogram
}

Component({
_timer: '',
properties: {
bar: {
type: Object,
Expand All @@ -490,7 +489,6 @@ import WX = WechatMiniprogram
expectType<Foo>(this.data.bar)
expectType<Foo>(this.properties.bar)
expectType<Foo[]>(this.getData())
expectType<string>(this._timer)
},
}
})
Expand Down
2 changes: 0 additions & 2 deletions types/wx/lib.wx.component.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ declare namespace WechatMiniprogram.Component {
Partial<Behavior<TBehavior>> &
Partial<OtherOption> &
Partial<Lifetimes> &
// 有很大几率会在 this.xxx 上使用一些暂存的变量,应该像Page一样支持传入自定义属性
Partial<TCustomInstanceProperty> &
ThisType<
Instance<
TData,
Expand Down

0 comments on commit 3a100d0

Please sign in to comment.