We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 ,不知道能不能解决问题。
The text was updated successfully, but these errors were encountered:
可以复现,这个是类型定义 https://github.com/guyskk/hami-vuex/blob/main/src/index.d.ts
Sorry, something went wrong.
我看了类型定义的,感觉没什么问题。所以不是很清楚问题出在哪里
No branches or pull requests
如上面代码所示,getter 的返回值不能正常自动推断,需要手动指定返回值的类型。
查找到一个相关issue microsoft/TypeScript#49511 ,不知道能不能解决问题。
The text was updated successfully, but these errors were encountered: