-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
bugSomething isn't workingSomething isn't working
Description
export const counterStore = hamiVuex.store({
// 设置一个唯一名称,方便调试程序和显示错误信息
$name: "counter",
// 定义状态
$state() {
return {
test: {
a: 1,
},
};
},
// ↓↓↓ 这里 testA 的返回值推断是 any 而不是 number
get testA() {
// 这里 this.test.a 的类型能正常推断为 number
return this.test.a;
},
});如上面代码所示,getter 的返回值不能正常自动推断,需要手动指定返回值的类型。
查找到一个相关issue microsoft/TypeScript#49511 ,不知道能不能解决问题。
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working