Skip to content

docs: Update reactivity-computed-watchers.md #1187

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

Merged
merged 2 commits into from
Aug 18, 2021

Conversation

Yukon123
Copy link

@Yukon123 Yukon123 commented Aug 18, 2021

Description of Problem

Computed is a funtion rather than method.So does the Watch and WatchEffect

Proposed Solution

Change method into funtion

Additional Information

We can learn from :https://v3.vuejs.org/guide/composition-api-introduction.html#standalone-computed-properties

Similar to ref and watch, computed properties can also be created outside of a Vue component with the computed function imported from Vue.

Just like how we set up a watcher on the user property inside our component using the watch option, we can do the same using the watch function imported from Vue. It accepts 3 arguments:

And it does show on source code

export function computed<T>( getter: ComputedGetter<T>, debugOptions?: DebuggerOptions ): ComputedRef<T>

Copy link
Contributor

@skirtles-code skirtles-code left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I concur, they are functions and not methods.

@NataliaTepluhina NataliaTepluhina merged commit 9e1ae06 into vuejs:master Aug 18, 2021
@Yukon123 Yukon123 deleted the patch-3 branch August 22, 2021 10:52
@Yukon123 Yukon123 changed the title Update reactivity-computed-watchers.md docs: Update reactivity-computed-watchers.md Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants