vue事件处理

1、监听事件:

详见Vue官网

2、下拉框数据获取及改变:

<div class="se">
			<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: '.se',
			data: {
				selected: 'A',
				options: [{
						text: 'One',
						value: 'A'
					},
					{
						text: 'Two',
						value: 'B'
					},
					{
						text: 'Three',
						value: 'C'
					}
				]
			}
		})
	</script>


猜你喜欢

转载自blog.csdn.net/w_t_y_y/article/details/79694336