为了实现类似这样,点击上边日期选择后切换到对应的月份,求教
html
<script src="//unpkg.com/vue/dist/vue.js"></script>
<script src="//unpkg.com/element-ui@2.13.2/lib/index.js"></script>
<div id="app">
<el-date-picker
v-model="value"
type="date"
placeholder="选择日期">
</el-date-picker>
<el-calendar v-model="value">
</el-calendar>
</div>
JS
var Main = {
data() {
return {
value: new Date()
}
}
}
var Ctor = Vue.extend(Main)
new Ctor().$mount('#app')