vue.js--form

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Vue 测试实例 - 菜鸟教程(runoob.com)</title>
<script src="https://cdn.bootcss.com/vue/2.2.2/vue.min.js"></script>
</head>
<body>
	<div id='app'>
		<p>输入框</p>
		<input type='text' placeholder='-----' v-model='text'>
		<p>输入内容:{{ text }}</p>
		<hr>
		<p>单复选框</p>
		<input type='checkbox' id='AAAA' value='Aaaa' v-model='checked'/>
		<label for='AAAA'>{{ checked }}</label>
		<hr>
		<p>多个复选框</p>
		<input type='checkbox' id='BB' value='Bb' v-model='checkedNames'/>
		<label for='BB'>Bb</label>
		<input type='checkbox' id='CC' value='Cc' v-model='checkedNames'/>
		<label for='CC'>Cc</label>
		<p>选择结果:{{ checkedNames }}</p>
		<hr>
		<p>单选框</p>
		<input type='radio' id='DD' value='dd' v-model='picked'/>
		<label for='DD'>dd</label>
		<input type='radio' id='EE' value='ee' v-model='picked'/>
		<label for='EE'>ee</label>
		<hr>
		<p>下拉框</p>
		<select v-model='selected'>
			<option value=''>请选择。。。</option>
			<option value='aa'>AA</option>
			<option value='bb'>BB</option>
		</select>
		<hr>
		<p>单复选框</p>
		<input type='checkbox' id='HH' value='Hh' v-model='checkedOnly' @click="changeAllChecked()"/>
		<label for='HH'>{{ checkedOnly }}</label>
		<p>多个复选框</p>
		<input type='checkbox' id='FF' value='Ff' v-model='checkeds'/>
		<label for='FF'>Ff</label>
		<input type='checkbox' id='GG' value='Gg' v-model='checkeds'/>
		<label for='GG'>Gg</label>
		<p>选择结果:{{ checkeds }}</p>
		
	</div>
	
	<script>
		new Vue({
			el:'#app',
			data:{
				text: '',
				checked: false,
				checkedNames: [],
				picked:'dd',
				selected: '',
				checkedOnly: false,
				checkeds:[],
				checkedAll:["Ff", "Gg"]
			},
			methods:{
				changeAllChecked: function(){
					if(this.checkedOnly){
						this.checkeds = this.checkedAll
					}else{
						this.checkeds =[]
					}
				}
			},
			watch:{
				"checkeds": function(){
					if(this.checkeds.length == this.checkedAll.length){
						this.checkedOnly = true
					} else {
						this.checkedOnly = false
					}
				}
			}
		})
	</script>
</body>
</html>

  

转载于:https://www.cnblogs.com/cherryblog/p/7700675.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
10:35:56.822 Module build failed (from ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js): 10:35:56.830 SassError: Undefined variable: "$u-form-item-height". 10:35:56.830 on line 210 of D:\ideaWorkSpace\ehl-wx\applicationCenter\knowledgeBase\addQuestion.vue 10:35:56.839 >> line-height: $u-form-item-height; 10:35:56.848 ------------------^ 10:35:56.856 Module build failed (from ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js): 10:35:56.863 SassError: Undefined variable: "$u-form-item-height". 10:35:56.873 on line 220 of D:\ideaWorkSpace\ehl-wx\applicationCenter\examine\answerQuestion.vue 10:35:56.873 >> line-height: $u-form-item-height; 10:35:56.880 --------------------^ 10:35:56.880 Module build failed (from ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js): 10:35:56.889 SassError: Undefined variable: "$u-form-item-height". 10:35:56.896 on line 220 of D:\ideaWorkSpace\ehl-wx\applicationCenter\knowledgeBase\answerQuestion.vue 10:35:56.903 >> line-height: $u-form-item-height; 10:35:56.904 --------------------^ 10:35:56.913 Module build failed (from ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js): 10:35:56.913 SassError: Undefined variable: "$u-form-item-height". 10:35:56.921 on line 232 of D:\ideaWorkSpace\ehl-wx\applicationCenter\examine\addQuestion.vue 10:35:56.930 >> line-height: $u-form-item-height; 10:35:56.930 ------------------^ 10:35:56.938 Module build failed (from ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js): 10:35:56.938 SassError: Undefined variable: "$u-form-item-height". 10:35:56.946 on line 350 of D:\ideaWorkSpace\ehl-wx\pages\service\addService.vue 10:35:56.947 >> line-height: $u-form-item-height; 10:35:56.954 -------------------^解决
07-14
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值