https://github.com/vueComponent/vue-ref
You can use the callback to get a reference like react at vue2.x
https://github.com/vueComponent/vue-ref
Last synced: 8 months ago
JSON representation
You can use the callback to get a reference like react at vue2.x
- Host: GitHub
- URL: https://github.com/vueComponent/vue-ref
- Owner: vueComponent
- License: mit
- Created: 2018-11-15T02:36:37.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T02:51:36.000Z (almost 2 years ago)
- Last Synced: 2025-03-18T16:07:55.443Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 18.6 KB
- Stars: 100
- Watchers: 4
- Forks: 14
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vue-ref
You can use the callback to get a reference like react.
[](https://npmjs.org/package/vue-ref) [](https://npmjs.org/package/vue-ref)
```bash
$ npm install vue-ref --save
```
```js
import ref from 'vue-ref'
Vue.use(ref)
```
```html
hello
{{ n }}
```
| 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.