Iview DatePicker 限制選擇當(dāng)前月份及以后的月份
更新時間:2024年11月18日 11:24:32 作者:Э時間行者于我
文章介紹了如何使用iviewDatePicker組件限制用戶只能選擇當(dāng)前月份及以后的月份,并提供了相關(guān)的html代碼和js代碼示例,感興趣的朋友跟隨小編一起看看吧
iview DatePicker之前月份禁用且下月可用
html代碼
<DatePicker type="month" :options="options4" :value="dialogForm.estimatedStartTimeWithCreate" @on-change="monthTime($event, 'loadDateStart')" placeholder="請選擇時間" class="itemMonth" style="width: 210px"></DatePicker>
js代碼
data() { return { dialogForm: { estimatedStartTimeWithCreate: '', // 綁定的日期值 }, options4: { disabledDate(date) { const disabledDay = new Date() return date && date.valueOf() < disabledDay.setMonth(disabledDay.getMonth() - 1) } } } }, methods: { monthTime(val) { console.log('monthTime:', val) this.dialogForm.estimatedStartTimeWithCreate = val } }
到此這篇關(guān)于Iview DatePicker 僅允許選擇當(dāng)前月份及以后的月份的文章就介紹到這了,更多相關(guān)Iview DatePicker僅允許選擇當(dāng)前月份內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
Bootstrap基本組件學(xué)習(xí)筆記之縮略圖(13)
這篇文章主要為大家詳細(xì)介紹了Bootstrap基本組件學(xué)習(xí)筆記之縮略圖,具有一定的參考價值,感興趣的小伙伴們可以參考一下2016-12-12一款JavaScript壓縮工具:X2JSCompactor
一款JavaScript壓縮工具:X2JSCompactor...2007-06-06jJavaScript中toFixed()和正則表達(dá)式的坑
這篇文章主要介紹了jJavaScript中toFixed()和正則表達(dá)式的坑,toFixed方法可以把Number四舍五入為指定小數(shù)位數(shù)的數(shù)字,具體詳細(xì)內(nèi)容需要的小伙伴可以參考一下2022-04-04