question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

vm.refs[] => vm.refs() to allow objects as _ref?

See original GitHub issue

i’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:closed
  • Created 7 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
iamjohnlongcommented, Mar 26, 2016

fyi I’m happy you went in this direction, the use case is a lot cleaner. 👍

0reactions
leeoniyacommented, Mar 25, 2016

fastclick has been removed. _ref namespacing has been implemented as it’s more valuable than the more limited object _refs

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found