自定义组件使用 v-model
<my-component v-model="data"></my-component>
在组件my-component中,通过this.$emit(‘input’)就可以改变data的值了。
this._uid
<div :id="eleId"></div>
<script>
computed: {
eleId () {
return `count_${this._uid}`
}
}
</script>
每一个vue实例属性中都有一个this._uid
, 每个组件中的this._uid
值都不相同, 唯一的