Element DatePicker 日期选择器

示例

<div id="app">
    <template>
        <div class="block">
            <el-button icon="el-icon-arrow-left" circle @click="changeDate(-1)"></el-button>
            <el-date-picker v-model="date1" type="date" placeholder="选择日期">
            </el-date-picker>
            <el-button icon="el-icon-arrow-right" circle @click="changeDate(1)"></el-button>
        </div>
    </template>
</div>

<script>
let tmp = new Vue({
    el: "#app",
    data: {
        date1: new Date(),
    },
    methods: {
        "changeDate": function (d) {
            this.date1 = new Date(this.date1.setDate(this.date1.getDate() + d))
        },
    }
})
</script>
posted @ 2020-11-23 15:57  太晓  阅读(272)  评论(0编辑  收藏  举报