Skip to content

Why does the template's ordinary function inside script setup looks reactive? #6336

Discussion options

You must be logged in to vote

Hi!

There is no difference between methods and computed in becoming reactive itself.
However, computed is better in the sense that it is recomputed only when there is a change in the reactive element on which it depends.

So it is only natural that fn() is reactive in your demo.

Have a nice day :)

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by lxxorz
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants