表单输入绑定
<div id="v-model-basic" class="demo"> <input v-model="message" placeholder="edit me" /> <p>Message is: {{ message }}</p> </div>
.demo { font-family: sans-serif; border: 1px solid #eee; border-radius: 2px; padding: 20px 30px; margin-top: 1em; margin-bottom: 40px; user-select: none; overflow-x: auto; }
Vue.createApp({ data() { return { message: '' } } }).mount('#v-model-basic')