BUG: fail to infer other getters type in getter #1076
-
reproduction url: https://stackblitz.com/edit/github-ev9fpm?file=src/stores/counter.ts In both two ways, the getter |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
As documented, you need to type the return when using getters: {
rights: (state) => state.userInfo?.rights,
menuRights(): UserInfo['rights'] | undefined {
return this.rights?.filter((v) => v.type === 0);
},
}, |
Beta Was this translation helpful? Give feedback.
-
Hello, @posva! Pinia is gorgeous! Could you check similar case, pls? And without dynamic: |
Beta Was this translation helpful? Give feedback.
-
what do I tell my colleagues about this in our code review? and also how can I access an action from a getter? |
Beta Was this translation helpful? Give feedback.
As documented, you need to type the return when using
this.
in getters;