'state' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
Vue version
3.0.0
Link to minimal reproduction
//
Steps to reproduce
type State = { isSelf?: ComputedRef
; }; const state = reactive
({ form: { authRelation: 2 }, isSelf: computed(() => { return state.form?.authRelation == 2; }), }); 3.yarn serve
but: below is ok
const state = reactive
What is expected?
sucessed
What is actually happening?
yes
System Info
No response
Any additional comments?
No response
Hello @xiaoyongchen
Thank your for your interest in this project.
However, your issue is a usage/support question, and the issue tracker is reserved exclusively for bug reports and feature requests (as outlined in our Contributing Guide).
We encourage you to ask it on Discord chat or Stack Overflow or on our and are happy to help you out there.
computed's needs to be annotated here as aotherwise, the type of state
is circular and therfore not inferrable for TS.