<body> <div id="root"> <form action="" @submit.prevent="demo"> <label for="TW"> Name:</label> <input type="text" id="TW" v-model.trim="userInfo.account"><br><br> Password: <input type="password" id="pa" v-model="userInfo.password"><br><br> Age: <input type="number" v-model.number="userInfo.age"> <br><br> Gender: <input type="radio" name="sex" value="male" v-model="userInfo.sex">Male<input type="radio" name="sex" v-model="userInfo.sex" value="female">Female<br><br> Hobbies: Campus: <select v-model="userInfo.city"> <option value="school">Please select a campus</option> <option value="beijing">Beijing</option> <option value="shanghai">Shanghai</option> <option value="shenzhen">Shenzhen</option> </select> <br><br> <input type="checkbox" v-model="userInfo.hobby" value="study"> Study<input type="checkbox" v-model="userInfo.hobby" value="sing"> Sing<input type="checkbox" v-model="userInfo.hobby" value="dance"> Dance<input type="checkbox" v-model="userInfo.hobby" value="game"> King<br><br> Other information: <textarea name="" v-model.lazy="userInfo.other"></textarea><br><br> <input type="checkbox" v-model="userInfo.agree"> Read and accept the <a href="#">User Agreement</a><button>Submit</button> </form> </div> <script> Vue.config.productionTip = false; new Vue({ el: '#root', data: { userInfo: { account: '', password: '', age: '', sex: 'female', city: 'beijing', hobby: [], other: '', agree: '', } }, methods: { demo() { console.log(JSON.stringify(this.userInfo)); } } }) </script> </body> SummarizeThis article ends here. I hope it can be helpful to you. I also hope you can pay more attention to more content on 123WORDPRESS.COM! You may also be interested in:
|
<<: 18 Web Usability Principles You Need to Know
>>: How to deploy k8s in docker
Due to some of its own characteristics (locking t...
This article shares the specific code of Vue2.0 t...
Table of contents 1. Build using the official sca...
1. Install mutt sudo apt-get install mutt 2. Inst...
export default ({ url, method = 'GET', da...
MySQL has the following logs: Error log: -log-err...
Permission denied: The reason for this is: there ...
This article is original by 123WORDPRESS.COM Ligh...
Preface We all know that startups initially use m...
In daily maintenance, threads are often blocked, ...
1. Why set maxPostSize? The tomcat container has ...
Table of contents 1. Conditions for joint index f...
Preface In order to follow the conventional WEB l...
Table of contents 1. Development Environment 2. I...
Table of contents origin Virtual Memory Paging an...