Private properties prefixed with `$_` (dollar underscore) are not available inside component
See original GitHub issueVersion
2.5.16
Reproduction link
https://jsfiddle.net/jfyLx256/
Steps to reproduce
Prefix a property with $_
and try to reference it within the component or template.
What is expected?
$_
prefixed properties should be rendered in template and available within the component.
What is actually happening?
$_
props are undefined. Not rendered in template and undefined
in component logic.
Private property names are described in the Vue style guide and the $_
form is officially recommended. https://vuejs.org/v2/style-guide/#Private-property-names-essential.
I first noticed this in a project built with vue-cli@3.0.0-beta.16.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
What does the dollar prefix ($) mean in Vue.js? - Stack Overflow
$ is for public instance properties: As for the $ prefix, its purpose within the Vue ecosystem is special instance properties that are...
Read more >I cannot to dollar sign($) to reference any property wrappers ...
The $ prefixed property for your property wrapper returns the value that you have as your property wrapper's projectedValue property. If you don ......
Read more >Do you use underscores and dollarsigns in your code? - Reddit
Private fields were introduced based on this underscore pattern. You should definitely use them instead of underscores, as they make the ...
Read more >Google TypeScript Style Guide
Do not use trailing or leading underscores for private properties or methods. Do not use the opt_ prefix for optional parameters.
Read more >Name and organize components - Figma Help Center
Not sure where to start with building a Component Library? ... Expanded menu in Assets Panel showing Components within the file.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@chrisvfritz do you think we should add a note about them not being proxied in the style guide?
@VitorLuizC
https://vuejs.org/v2/api/#data