<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- import CSS -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<link rel="stylesheet" href="./t.css">
</head>
<body>
<div id="app">
<template>
<el-date-picker v-model="buildDate" :picker-options="pickerOptions" type="date" style="width: 90%"
value-format="yyyy-MM-dd" placeholder="选择日期" />
</template>
</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 src="https://cdn.bootcss.com/moment.js/2.20.1/moment.min.js"></script>
<script src="https://cdn.bootcss.com/moment.js/2.20.1/locale/zh-cn.js"></script>
<script>
new Vue({
el: '#app',
data() {
return {
buildDate: '',
pickerOptions: {
disabledDate(time) { }
}
}
},
created() {
this.pickerOptions.disabledDate = (time) => {
console.log(time);
// console.log(moment(date, 'YYYY-MM-DD').endOf('month').format('YYYY-MM-DD'), 'this.assetOpenTime')
const now = moment(time).format('YYYY-MM-DD')
// const bookStart = moment(date).format('YYYY-MM')
const bookStart = moment(new Date()).format('YYYY-MM-DD')
return now > bookStart
}
},
methods: {
}
})
</script>
</html>
网友评论