JSFiddle - React, Tailwind, and code Playground
HTML
<script src="//unpkg.com/vue/dist/vue.js"></script>
<script src="//unpkg.com/element-ui@1.3.7/lib/index.js"></script>
<div id="app">
<template>
<div class="block">
<span class="demonstration">开始日期:</span>
<el-date-picker v-model="start_time" type="datetime" placeholder="选择日期时间" align="right">
</el-date-picker>
<span class="demonstration">结束日期:</span>
<el-date-picker v-model="end_time" type="datetime" placeholder="选择日期时间" align="right" :picker-options="pickerOptions1">
</el-date-picker>
</div>
</template>
</div>
SCSS
@import url("//unpkg.com/element-ui@1.3.7/lib/theme-default/index.css");
Babel + JSX
var Main = {
data() {
return {
pickerOptions1: {
disabledDate: current => {
return current && current.valueOf() < this.start_time.valueOf()
}
},
start_time: '',
end_time: ''
};
}
};
var Ctor = Vue.extend(Main)
new Ctor().$mount('#app')