vue源码

<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" :options="options3" placeholder="Select date" style="width: 200px"></date-picker>
        </i-col>
        <i-col span="12">
            <date-picker type="date" :options="options4" placeholder="Select date" style="width: 200px"></date-picker>
        </i-col>
    </row>
</div>

js源码

var Main = {
        data () {
            return {
                options3: {
                    disabledDate (date) {
                        return date && date.valueOf() < Date.now() - 86400000;
                    }
                },
                options4: {
                    disabledDate (date) {
                        const disabledDay = date.getDate();
                        return disabledDay === 15;
                    }
                }
            }
        }
    }

var Component = Vue.extend(Main)
new Component().$mount('#app')

效果如下:

Logo

前往低代码交流专区

更多推荐