本文實(shí)例講述了VUE v-model表單數(shù)據(jù)雙向綁定。分享給大家供大家參考,具體如下:
創(chuàng)新互聯(lián)主營(yíng)安丘網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營(yíng)網(wǎng)站建設(shè)方案,app軟件定制開(kāi)發(fā),安丘h5微信平臺(tái)小程序開(kāi)發(fā)搭建,安丘網(wǎng)站營(yíng)銷(xiāo)推廣歡迎安丘等地區(qū)企業(yè)咨詢(xún)<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Vue v-model雙向綁定</title> <script src="https://cdn.bootcss.com/vue/2.2.2/vue.min.js"></script> </head> <body> <div id="app"> <textarea v-model = "message" placeholer = '請(qǐng)?jiān)诖溯斎胛淖?></textarea> <span>{{message}}</span> </br> <input type="text" v-model="data.name"/> <span>姓名:{{data.name}}</span> </br> <input type="radio" id="boy" value="男" v-model="data.gender"/> <label for="boy">男</label> <input type="radio" id="girl" value="女" v-model="data.gender"/> <lable for="girl">女</lable> <span>{{data.gender}}</span> <br/> <input type="checkbox" id="item1" value="閱讀" v-model="data.interest"/> <lable for="item1">閱讀</lable> <input type="checkbox" id="item2" value="打球" v-model="data.interest"/> <lable for="item2">打球</lable> <input type="checkbox" id="item3" value="體操" v-model="data.interest"/> <lable for="checkbox">體操</lable> <br/> <span>{{data.interest}}</span> <select v-model="data.identity"> <option value="java" selected>java</option> <option value="web">web</option> <option value="hr">hr</option> </select> <span>身份:{{data.identity}}</span> <!--select:用 v-for 渲染的動(dòng)態(tài)選項(xiàng):--> <select v-model="selected"> <option v-for="option in options" v-bind:value="option.value"> {{ option.text }} </option> </select> <span>Selected: {{ selected }}</span> </div> <script> new Vue({ el: '#app', data: { message: '6', data: { name: '', gender: '', interest: [], identity: '' }, selected: 'A', options: [ { text: 'One', value: 'A' }, { text: 'Two', value: 'B' }, { text: 'Three', value: 'C' } ] } }) </script> </body> </html>
分享題目:VUEv-model表單數(shù)據(jù)雙向綁定完整示例-創(chuàng)新互聯(lián)
地址分享:http://aaarwkj.com/article2/hoioc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供小程序開(kāi)發(fā)、用戶體驗(yàn)、關(guān)鍵詞優(yōu)化、電子商務(wù)、App開(kāi)發(fā)、軟件開(kāi)發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容