当前位置:网站首页>Form forms and form elements (input, select, textarea, etc.)
Form forms and form elements (input, select, textarea, etc.)
2022-06-28 00:53:00 【qq_ forty-six million three hundred and two thousand two hundre】

<template>
<div class="profile">
<form>
<!-- label for="account" , When you click label when ,id="account" The elements of will focus -->
<label for="account"> account number :</label>
<input type="text" v-model="userInfo.account" id="account"/><br/><br/>
<label for="password"> password :</label>
<input type="text" v-model="userInfo.password" id="password"/><br/><br/>
Gender :
<label for="male"> male :</label>
<!-- v-model.trim Remove the first space -->
<input type="radio" v-model.trim="userInfo.sex" value="male" name="sex" id="male"/>
<label for="female"> Woman :</label>
<input type="radio" v-model="userInfo.sex" value="female" name="sex" id="female"/><br/><br/>
<label for="age"> Age :</label>
<!-- type="number" control input You can only enter Numbers 、 Decimal point and e/E,+,- etc. ; however value The type of value is still string;v-model.number Change the entered number to number type -->
<!-- therefore type="number" and v-model.number To be used together -->
<!-- onkeyup="value=value.replace(/[^\d]/g, '')" Can be controlled input Decimal point and... Cannot be entered e/E,+,- etc. , You can only enter Numbers ;-->
<input type="number" v-model.number="userInfo.age" id="age" onkeyup="value=value.replace(/[^\d]/g, '')"/><br/><br/>
hobby :
<label for="game"> Play the game </label>
<input type="checkbox" v-model="userInfo.hobby" value="game" id="game"/>
<label for="run"> running </label>
<input type="checkbox" v-model="userInfo.hobby" value="run" id="run"/>
<label for="eat"> having dinner </label>
<input type="checkbox" v-model="userInfo.hobby" value="eat" id="eat"/><br/><br/>
Campus :
<select v-model="userInfo.school">
<option value=""> Please select Campus </option>
<option value="beijing"> Beijing </option>
<option value="shanghai"> Shanghai </option>
<option value="hangzhou"> Hangzhou </option>
</select><br/><br/>
<!-- v-model.lazy When you lose focus , And then put the latest value Value to userInfo.other -->
Other information :<textarea v-model.lazy="userInfo.other"></textarea><br/><br/>
<input type="checkbox" v-model="userInfo.agreement"/> Read and accept <a href="http://www.baidu.com"> User agreement </a><br/><br/>
<!-- form Medium button It has the default function of refreshing the page , So we need to use click.prevent -->
<button @click.prevent="submit"> Submit </button>
</form>
</div>
</template>
<script>
export default {
data() {
return {
userInfo: {
account: '',
password: '',
sex: 'male',
age: '',
hobby: [],
school: '',
other: '',
agreement: ''
}
}
},
methods: {
submit() {
console.log(this.userInfo);
}
}
}
</script>
边栏推荐
- Is it reliable to invest in exchange traded ETF funds? Is it safe to invest in exchange traded ETF funds
- 深入解析kubernetes controller-runtime
- Electron window background transparent borderless (can be used to start the page)
- electron窗口背景透明无边框(可用于启动页面)
- Alchemy (9): simple but not simple, never-ending test -- always_ run
- The limits of Technology (11): interesting programming
- #795 Div.2 E. Number of Groups set *
- 投资场内ETF基金是靠谱吗,场内ETF基金安全吗
- RNA SEQ introduction practice (I): upstream data download, format conversion and quality control cleaning
- Sword finger offer 65 Add without adding, subtracting, multiplying, dividing
猜你喜欢

Message Oriented Middleware for girlfriends

Modern programming language: rust

Promise是什么

logging日志的使用

Alchemy (7): how to solve problems? Only reconstruction

Hcip/hcie Routing & Switching / datacom Reference Dictionary Series (19) comprehensive summary of PKI knowledge points (public key infrastructure)

Electron window background transparent borderless (can be used to start the page)

给女朋友看的消息中间件

Overview and construction of redis master-slave replication, sentinel mode and cluster

Proe/Creo产品结构设计-钻研不断
随机推荐
投资场内ETF基金是靠谱吗,场内ETF基金安全吗
Local visualization tool connects to redis of Alibaba cloud CentOS server
吴恩达《机器学习》课程总结(11)_支持向量机
A summer party
快速掌握grep命令及正则表达式
章凡:飞猪基于因果推断技术的广告投后归因
[untitled]
[black apple series] m910x perfect black apple system installation tutorial – 2 making system USB disk -usb creation
#795 Div.2 E. Number of Groups set *
Is it safe to open a new bond registration account? Is there any risk?
软件工程作业设计(1): [个人项目] 实现一个日志查看页面
Alchemy (7): how to solve problems? Only reconstruction
Overview and construction of redis master-slave replication, sentinel mode and cluster
Efficient supplier management in supply chain
炼金术(6): 可迭代的模型和用例
[untitled]
Mysql database tourism management system_ Jsp+mysql tourism management system based on SSM [easy to understand]
796 div.2 C. managing history thinking
技术的极限(11): 有趣的编程
Deployment and test of crtmp live video server