Skip to content

Variables starting with _ causes warning: "not defined on the instance but referenced during render" #12587

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

Closed
lsdsjy opened this issue Jun 29, 2022 · 1 comment

Comments

@lsdsjy
Copy link
Contributor

lsdsjy commented Jun 29, 2022

Version

2.7.0-beta.8

Reproduction link

codesandbox.io

Steps to reproduce

See console output

What is expected?

One warning:
Avoid using variables that start with _ or $ in setup().

(Like in Vue 3)

What is actually happening?

Two warnings:

Avoid using variables that start with _ or $ in setup().

Property or method "_a" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property.


I think the second warning may be redundant.

@yyx990803
Copy link
Member

This is fine since both warnings make sense and they do not affect behavior.

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

No branches or pull requests

2 participants