Skip to content
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

v-memo #18

Open
2 tasks
sxzz opened this issue Nov 29, 2023 · 0 comments
Open
2 tasks

v-memo #18

sxzz opened this issue Nov 29, 2023 · 0 comments
Assignees

Comments

@sxzz
Copy link
Member

sxzz commented Nov 29, 2023

v-memo in vapor mode is completely different, compared to vue-core. Since in vapor mode, we use effect (aka watchEffect) to track & update DOM nodes.

So to implement it, I think watch function is enough.

<div v-memo="[msg]">{{ msg }}{{ count }}</div>

Compiles to

watch([msg], () => {
  setText(...)
})

  • Runtime watch function
  • Compiler part
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants