vue-ref
use the callback to get a reference like react
Last updated 5 years ago by tangjinzhou .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install vue-ref 
SYNC missed versions from official npm registry.

vue-ref

You can use the callback to get a reference like react.

NPM version NPM downloads

$ npm install vue-ref --save
import ref from 'vue-ref'
Vue.use(ref)
<!-- vm.dom will be the DOM node -->
<p v-ref="c => this.dom = c">hello</p>

<!-- vm.child will be the child component instance -->
<child-component v-ref="c => this.child = c"></child-component>

<span v-for="n in 10" :key="n" v-ref="(c, key) => {...}">{{ n }} </span>
Property Description Type
v-ref a callback function function(dom | vnode, key)

In this callback function, you should not change any reactive data. Otherwise the render will enter an infinite loop.

Current Tags

  • 2.0.0                                ...           latest (5 years ago)

8 Versions

  • 2.0.0                                ...           5 years ago
  • 1.0.6                                ...           6 years ago
  • 1.0.5                                ...           6 years ago
  • 1.0.4                                ...           6 years ago
  • 1.0.3                                ...           6 years ago
  • 1.0.2                                ...           6 years ago
  • 1.0.1                                ...           6 years ago
  • 1.0.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |