diff --git a/example/docs/zh-CN/components/transition.md b/example/docs/zh-CN/components/transition.md index 551c07c0..8e55504a 100644 --- a/example/docs/zh-CN/components/transition.md +++ b/example/docs/zh-CN/components/transition.md @@ -42,7 +42,7 @@ export default { ::: -::: title 基础使用 +::: title 淡入淡出 ::: ::: demo 使用 `lay-transition` 标签, 为元素提供过渡动画 @@ -75,4 +75,27 @@ export default { } +::: + +::: title Transition 属性 +::: + +::: table + +| 属性 | 描述 | 类型 |默认值 | 可选值 | +| ------------ | ---------------- | ------------- | ---- | ---- | +| enable | 启用 | `boolean` | `true` | `true` `false` | +| type | 类型 | `string` | `collapse` | -- | + +::: + +::: title Transition 属性值 +::: + +::: table + +| 属性值 | 描述 | +| ------------ | ---------------- | +| collapse | 折叠动画 | +| fade | 淡入淡出 | ::: \ No newline at end of file diff --git a/example/docs/zh-CN/guide/changelog.md b/example/docs/zh-CN/guide/changelog.md index 04d42a79..9e734bd3 100644 --- a/example/docs/zh-CN/guide/changelog.md +++ b/example/docs/zh-CN/guide/changelog.md @@ -17,7 +17,7 @@

0.4.3 2022-03-27

diff --git a/src/component/datePicker/day.ts b/src/component/datePicker/day.ts index fed8a56c..f90add57 100644 --- a/src/component/datePicker/day.ts +++ b/src/component/datePicker/day.ts @@ -23,6 +23,13 @@ const getYear = () => { return getDate().getFullYear(); }; +/** + * 获取当前月份 + */ +const getMonth = () => { + return getDate().getMonth(); +} + /** * 获取月份天数 * @@ -33,4 +40,4 @@ const getDayLength = (year: number, month: number): number => { return new Date(year, month + 1, 0).getDate(); }; -export { getDayLength, getYears }; +export { getDayLength, getYears, getDate, getMonth, getYear }; diff --git a/src/component/datePicker/index.vue b/src/component/datePicker/index.vue index e01312ae..8ca615a2 100644 --- a/src/component/datePicker/index.vue +++ b/src/component/datePicker/index.vue @@ -242,25 +242,13 @@ import { } from "vue"; import LayInput from "../input/index.vue"; import LayDropdown from "../dropdown/index.vue"; -import { getDayLength, getYears } from "./day"; +import { getDayLength, getYears, getDate, getMonth, getYear } from "./day"; const $emits = defineEmits(["update:modelValue"]); const WEEK_NAME = ["日", "一", "二", "三", "四", "五", "六"]; -const MONTH_NAME = [ - "1月", - "2月", - "3月", - "4月", - "5月", - "6月", - "7月", - "8月", - "9月", - "10月", - "11月", - "12月", -]; +const MONTH_NAME = ["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]; + const hms = ref({ hh: "00", mm: "00", ss: "00" }); const els = [ { count: 24, type: "hh" }, @@ -278,9 +266,9 @@ const props = withDefaults(defineProps(), { type: "date", }); -const currentDate = new Date(); -const currentYear = ref(currentDate.getFullYear()); -const currentMonth = ref(currentDate.getMonth()); +const currentDate = getDate(); +const currentYear = ref(getYear()); +const currentMonth = ref(getMonth()); const yearList = ref(getYears()); const dateList = ref([]);