diff --git a/example/docs/zh-CN/guide/changelog.md b/example/docs/zh-CN/guide/changelog.md
index 88c323f7..4ff9e073 100644
--- a/example/docs/zh-CN/guide/changelog.md
+++ b/example/docs/zh-CN/guide/changelog.md
@@ -16,6 +16,7 @@
0.4.3 2022-03-27
+ - [新增] upload 文件上传组件。
- [新增] date-picker 组件 name 属性, 等同原生 name 属性。
- [新增] date-picker 组件 type 属性 date 值, 支持日期选择。
- [新增] date-picker 组件 type 属性 datetime 值, 支持日期时间选择。
diff --git a/src/component/datePicker/index.vue b/src/component/datePicker/index.vue
index 0b1a041b..176a8f2c 100644
--- a/src/component/datePicker/index.vue
+++ b/src/component/datePicker/index.vue
@@ -73,12 +73,16 @@
@@ -120,7 +124,8 @@
>
@@ -174,7 +179,8 @@
>
@@ -218,7 +224,8 @@
>
@@ -288,22 +295,21 @@ const dateValue = computed(() => {
.hour(hms.value.hh)
.minute(hms.value.mm)
.second(hms.value.ss);
- switch(props.type)
- {
- case 'date':
- momentVal = momentObj.format("YYYY-MM-DD");
- break;
- case 'datetime':
- momentVal = momentObj.format("YYYY-MM-DD hh:mm:ss");
- break;
- case 'year':
- momentVal = momentObj.format("YYYY");
- break;
- case 'month':
- momentVal = momentObj.format("MM");
- break;
+ switch (props.type) {
+ case "date":
+ momentVal = momentObj.format("YYYY-MM-DD");
+ break;
+ case "datetime":
+ momentVal = momentObj.format("YYYY-MM-DD hh:mm:ss");
+ break;
+ case "year":
+ momentVal = momentObj.format("YYYY");
+ break;
+ case "month":
+ momentVal = momentObj.format("MM");
+ break;
default:
- momentVal = momentObj.format();
+ momentVal = momentObj.format();
}
$emits("update:modelValue", momentVal);
return momentVal;
@@ -370,19 +376,15 @@ const handleDayClick = (item: any) => {
};
// 确认事件
-const ok = () => {
-
-};
+const ok = () => {};
// 现在时间
const now = () => {
currentDay.value = moment().valueOf();
-}
+};
// 清空日期
-const clear = () => {
-
-}
+const clear = () => {};
// 切换年月
const changeYearOrMonth = (type: "year" | "month", num: number) => {
diff --git a/src/component/upload/index.vue b/src/component/upload/index.vue
index 754e768e..5131a51e 100644
--- a/src/component/upload/index.vue
+++ b/src/component/upload/index.vue
@@ -7,7 +7,7 @@ export default {
import "./index.less";
import { Recordable } from "../../types";
import { layer } from "@layui/layer-vue";
-import { ref, useSlots, withDefaults, onMounted, defineExpose } from "vue";
+import { ref, useSlots, withDefaults } from "vue";
import { templateRef } from "@vueuse/core";
// 组件的参数字段类型
@@ -32,6 +32,7 @@ const props = withDefaults(defineProps(), {
number: 0,
drag: false,
});
+
const slot = useSlots();
const slots = slot.default && slot.default();
const emit = defineEmits(["choose", "before", "done", "error"]);