From d33042eade239cd58f6c3d1f6c7be77e137c7b22 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B0=B1=E7=9C=A0=E5=84=80=E5=BC=8F?= <854085467@qq.com>
Date: Sun, 27 Mar 2022 08:35:54 +0800
Subject: [PATCH] =?UTF-8?q?docs:=20=E6=A2=B3=E7=90=86=20transition=20?=
=?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=96=87=E6=A1=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
example/docs/zh-CN/components/transition.md | 25 ++++++++++++++++++++-
example/docs/zh-CN/guide/changelog.md | 2 +-
src/component/datePicker/day.ts | 9 +++++++-
src/component/datePicker/index.vue | 24 +++++---------------
4 files changed, 39 insertions(+), 21 deletions(-)
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
- [修复] menu 组件 level 属性不生效。
- - [修复] step 组件 line 连线不显示。
+
- [修复] step 组件 line 连线不显示。
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([]);