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

@@ -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[]>([]);