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
原文地址:https://www.cnblogs.com/love-zf/p/9949690.html
时间: 2024-11-07 15:07:38