标签:NPU code new ring class text mode model html
<div id="app">
"inputValue 的值:" + {{inputValue}}
<my-input v-model="inputValue"></my-input>
</div>
Vue.component(‘my-input‘, {
template: ‘<div><input type="text" ref="el" :value="value" @input="onInput"/></div>‘,
props: {
value: String
},
methods: {
onInput() {
this.$emit(‘input‘, this.$refs.el.value);
}
}
});
new Vue({
el: ‘#app‘,
data: {
inputValue: ‘10‘
}
});
标签:NPU code new ring class text mode model html
原文地址:https://www.cnblogs.com/xiaoyucoding/p/13225090.html