<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- import CSS -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
</head>
<body>
<div id="app">
<div>
<el-date-picker v-model="value1" type="date" placeholder="选择日期" value-format="yyyy-MM-dd"
@change="change1($event,option1,option2)">
</el-date-picker>
<el-date-picker v-model="value2" type="date" placeholder="选择日期" value-format="yyyy-MM-dd"
@change="(e)=>{change2(e,option1,option2)}">
</el-date-picker>
</div>
</div>
</body>
<!-- import Vue before Element -->
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<!-- import JavaScript -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script>
new Vue({
el: '#app',
data: function () {
return {
value1: '',
value2: '',
option1: 'option1',
option2: 'option2'
}
},
methods: {
change1(e, data1, data2) {
console.log(e)
console.log(data1 + data2)
},
change2(e, data1, data2) {
console.log(e)
console.log(data1 + data2)
}
}
})
</script>
</html>
网友评论