Thanks to visit codestin.com
Credit goes to github.com

Skip to content

New Feature: unwrapTemplate #802

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

Open
3 tasks done
sxzz opened this issue Sep 9, 2024 · 0 comments
Open
3 tasks done

New Feature: unwrapTemplate #802

sxzz opened this issue Sep 9, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@sxzz
Copy link
Member

sxzz commented Sep 9, 2024

Clear and concise description of the problem

Prevent auto-unwrap refs in <template>

https://vuejs.org/guide/essentials/reactivity-fundamentals.html#caveat-when-unwrapping-in-templates

Suggested solution

  • In development mode, inline template is disabled. Simply replace $setup with _ctx._.setupState.__v_raw.

  • In production mode, there's no $setup. The Vue compiler attaches unref() or .value directly. I'm unsure about this situation unless we analyze all variables in <script setup> like the Vue compiler does.

Alternative

No response

Additional context

No response

Validations

@sxzz sxzz added the enhancement New feature or request label Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant