2.2.0 • Published 3 years ago
vue-io-directive v2.2.0
vue-io-directive
在 vue 2 组件上双向绑定多个数据,灵感来自Angular
此库在vue 3中不可用,vue 3 可以在组件上支持多个v-model
Install
$ npm i vue-io-directive
使用
import Vue from "vue";
import { VueIoDirective } from "vue-io-directive";
Vue.directive("io", VueIoDirective);
Demo
<my-test v-io:name="parentName" v-io:pwd="parentPwd"></my-test>
<my-test v-io:name="obj.parentName" v-io:pwd="obj.parentPwd"></my-test>
<my-test v-io:child.name="parentName" v-io:child.pwd="parentPwd"></my-test>
<my-test v-io:child.name="obj.parentName" v-io:child.pwd="obj.parentPwd"></my-test>
v-io:name="arr[0]"
对于数组, 数据更新后ui也不会刷新,使用传统的emit- src目录下有
example
不懂可以看下