🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

vue-ref

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-ref

use the callback to get a reference like react

1.0.4
Source
npm
Version published
Weekly downloads
12K
8.81%
Maintainers
1
Weekly downloads
 
Created
Source

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>
PropertyDescriptionType
v-refa callback functionfunction(dom | vnode, key)

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

Keywords

vue

FAQs

Package last updated on 14 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts