docs: 梳理 transition 使用文档

This commit is contained in:
就眠儀式 2022-03-27 08:35:54 +08:00
parent 0e4bc9dbb3
commit d33042eade
4 changed files with 39 additions and 21 deletions

View File

@ -42,7 +42,7 @@ export default {
:::
::: title 基础使用
::: title 淡入淡出
:::
::: demo 使用 `lay-transition` 标签, 为元素提供过渡动画
@ -76,3 +76,26 @@ export default {
</script>
:::
::: title Transition 属性
:::
::: table
| 属性 | 描述 | 类型 |默认值 | 可选值 |
| ------------ | ---------------- | ------------- | ---- | ---- |
| enable | 启用 | `boolean` | `true` | `true` `false` |
| type | 类型 | `string` | `collapse` | -- |
:::
::: title Transition 属性值
:::
::: table
| 属性值 | 描述 |
| ------------ | ---------------- |
| collapse | 折叠动画 |
| fade | 淡入淡出 |
:::

View File

@ -17,7 +17,7 @@
<h3>0.4.3 <span class="layui-badge-rim">2022-03-27</span></h3>
<ul>
<li>[修复] menu 组件 level 属性不生效。</li>
<li>[修复] step 组件 line 连线不显示。
<li>[修复] step 组件 line 连线不显示。</li>
</ul>
</li>
</ul>

View File

@ -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 };

View File

@ -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<LayDatePickerProps>(), {
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<number[]>(getYears());
const dateList = ref<any[]>([]);