当前位置:网站首页>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>
边栏推荐
- #796 Div.2 C. Manipulating History 思维
- 现代编程语言:zig
- Summary of wuenda's machine learning course (11)_ Support vector machine
- 深入解析kubernetes controller-runtime
- 炼金术(9): 简约而不简单,永不停歇的测试 -- always_run
- Is it safe to open a new bond registration account? Is there any risk?
- MATLB|基于复杂网络的配电系统微电网优化配置
- Logging log usage
- Flutter SliverAppBar全解析,你要的效果都在这了!
- The Internet industry has derived new technologies, new models and new types of industries
猜你喜欢
![[paper reading | deep reading] sdne:structural deep network embedding](/img/6a/b2edf326f6e7ded83deb77219654aa.png)
[paper reading | deep reading] sdne:structural deep network embedding

Why are cloud vendors targeting this KPI?

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

Character interception triplets of data warehouse: substrb, substr, substring

吴恩达《机器学习》课程总结(11)_支持向量机

MongoDB-在windows电脑本地安装一个mongodb的数据库

Mongodb- install a mongodb database locally on the windows computer

吴恩达《机器学习》课程总结(14)_降维

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

Class文件结构和字节码指令集
随机推荐
#795 Div.2 E. Number of Groups set *
Introduction to data warehouse
SDF学习之扭曲模型
Leetcode 720. The longest word in the dictionary
最新MySQL高级SQL语句大全
JVM的内存模型简介
Internship: business process introduction
#796 Div.2 F. Sanae and Giant Robot set *
Promise是什么
electron窗口背景透明无边框(可用于启动页面)
#796 Div.2 C. Manipulating History 思维
#795 Div.2 D. Max GEQ Sum 单调栈
Matlab基本函数 length函数
现代编程语言:Rust (铁锈,一文掌握钢铁是怎样生锈的)
#795 Div.2 E. Number of Groups set *
Matlb| optimal configuration of microgrid in distribution system based on complex network
数据仓库入门介绍
哪个证券炒股开户佣金是最便宜,最安全的
券商买股票用什么app是比较好的,比较安全的
炼金术(4): 程序员的心智模型