VUE iview date-picker取时间范围...
x
HTML
<script src="//unpkg.com/vue/dist/vue.js"></script> <script src="//unpkg.com/iview/dist/iview.min.js"></script> <div id="app"> <row> <i-col span="12"> <date-picker type="date" v-bind:options="optionsDate"></date-picker> </i-col> </row> </div>
JS
var Main = { data () { return { optionsDate: { disabledDate: function (date) { var disabledDay = date.getFullYear();
//取1950年至今的时间范围. return disabledDay <= 1949 || date.valueOf() > Date.now(); }, }, } }, methods: { } } var Component = Vue.extend(Main) new Component().$mount('#app')
在jsfiddle中运行即可看到效果...
x