-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
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
bug: computed properties expect to be invoked #232
Comments
hello @anthony9187, computed props can be accessed outside the template scope by referring to them simply as There is also no need to invoke the computed property. The idea is that whenever you access the property (i.e. I've tried to search the docs, to see if it's documented wrongly somewhere, but couldn't find it. I may have missed something, so if you wouldn't mind please let us know where this was documented incorrectly (or confusing). |
Hey @michielvandergeest, sorry if my example was unclear - I have a computed property |
hey, thanks for the bump - will put it back on the agenda as for your last example: curious to see what does your computed property |
ahhh missed that in the screenshot:
i realize this probably doesn't need to be computed from a performance prospective, but being able to reference it as a class property is nice |
Thanks! I imagined it would look something like that. Now not to discard the actual issue (which we will look into), but I would not have used the computed property the way you are using it. I would either construct the ref string directly in the Hope that helps 🙂 |
I appreciate the recommendations! I'll try out those methods, thanks! |
According to the documentation (and functionally in practice), computed properties should be accessed as similarly to a getter when used outside of the template:
however typescript throws an error:
which looks like it's expecting
computedProperty
to be invoked:it's more of an annoying type issue than anything else, everything seems to function as expected
The text was updated successfully, but these errors were encountered: