vm.refs[] => vm.refs() to allow objects as _ref?
See original GitHub issuei’ve decided to change vm.refs
from an array to a getter function. app code updates should be trivial (unless you were iterating vm.refs): vm.refs[key]
will become vm.refs(key)
.
this is necessary for future-proofing the lib and allowing the internal refs
impl to be non-uniform. the change will pave the way for _ref as well as _key on nodes to be objects OR values, transparently backed by Map, Weakmap or Hash.
invoking vm.refs with multiple args should bring back an array of vnodes while invoking it with 0 args should bring back an object containing both the Map and the Hash where object and value refs are held respectively.
expect the change to drop in the next few days.
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Understanding refs in Vue - LogRocket Blog
Refs are Vue.js instance properties used to register a reference to HTML elements or child elements in the template of your application.
Read more >How to get onclick="vm.$refs.foo.addThing()" working in Vue ...
I'm trying to get my code which looks similar to this jsFiddle working. The code basically has onclick="vm.$refs.foo.addThing()" outside the Vue ...
Read more >Resilient File System (ReFS) overview | Microsoft Learn
The Resilient File System (ReFS) is Microsoft's newest file system, designed to maximize data availability, scale efficiently to large data ...
Read more >Accessing the DOM in Vue.js with $refs - Coding Explained -
We can do this by using the $refs property on our Vue instance. Let's log this to the console and see what it...
Read more >Ref in v-for, can't access it. why? - Vue Forum
The foo ref can access, but the bar can't access it. In object of $refs, can see the array of bar , but...
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
fyi I’m happy you went in this direction, the use case is a lot cleaner. 👍
fastclick has been removed. _ref namespacing has been implemented as it’s more valuable than the more limited object _refs