fix: date-picker 月份显示不正确

This commit is contained in:
就眠儀式 2022-03-16 00:02:24 +08:00
parent 0e39e81e5c
commit a4bfb2f5df
2 changed files with 20 additions and 20 deletions

View File

@ -18,7 +18,7 @@
>
<div class="laydate-set-ym">
<span @click="showYearPanel">{{ curYear }} </span
><span @click="showPanel = 'month'">{{ curMonth }} </span>
><span @click="showPanel = 'month'">{{ curMonth + 1 }} </span>
</div>
<i
class="layui-icon laydate-icon laydate-next-m"
@ -82,16 +82,17 @@
</div>
</div>
<div
class="layui-laydate" v-show="showPanel === 'year'"
>
<div class="layui-laydate" v-show="showPanel === 'year'">
<div class="layui-laydate-main laydate-main-list-0 laydate-ym-show">
<div class="layui-laydate-header">
<div class="laydate-set-ym">
<span class="laydate-time-text">选择年份</span>
</div>
</div>
<div class="layui-laydate-content" style="height: 220px;overflow-y: auto;">
<div
class="layui-laydate-content"
style="height: 220px; overflow-y: auto"
>
<ul class="layui-laydate-list laydate-year-list">
<li
v-for="item of yearList"
@ -132,7 +133,7 @@
>
<div class="laydate-set-ym">
<span @click="showYearPanel">{{ curYear }} </span
><span @click="showPanel = 'month'">{{ curMonth }} </span>
><span @click="showPanel = 'month'">{{ curMonth + 1 }} </span>
</div>
<i
class="layui-icon laydate-icon laydate-next-y"
@ -231,7 +232,6 @@ import LayDropdown from "../dropdown/index.vue";
defineProps({
modelValue: { type: String, required: false },
frontText: { type: String, required: false },
});
const $emits = defineEmits(["update:modelValue"]);

View File

@ -153,7 +153,7 @@ const components: Record<string, Component> = {
LayResult,
LayFullscreen,
LayConfigProvider,
LayDatePicker
LayDatePicker,
};
const install = (app: App, options?: InstallOptions): void => {
@ -237,7 +237,7 @@ export {
LayResult,
LayFullscreen,
LayConfigProvider,
LayDatePicker
LayDatePicker,
};
export { layer };