+
-
+
{{ rangeSeparator }}
-
+
@@ -92,8 +128,8 @@ export interface LayDatePickerProps {
min?: string;
range?: boolean;
rangeSeparator?: string;
- readonly?:boolean;
- allowClear?:boolean;
+ readonly?: boolean;
+ allowClear?: boolean;
}
const props = withDefaults(defineProps(), {
@@ -103,8 +139,8 @@ const props = withDefaults(defineProps(), {
simple: false,
range: false,
rangeSeparator: "至",
- readonly:false,
- allowClear:true,
+ readonly: false,
+ allowClear: true,
});
const dropdownRef = ref(null);
@@ -161,10 +197,13 @@ const getDateValue = () => {
.format("HH:mm:ss");
break;
case "yearmonth":
- dayjsVal = currentYear.value !== -1&¤tMonth.value !== -1?dayjs()
- .year(currentYear.value)
- .month(currentMonth.value)
- .format("YYYY-MM"):'';
+ dayjsVal =
+ currentYear.value !== -1 && currentMonth.value !== -1
+ ? dayjs()
+ .year(currentYear.value)
+ .month(currentMonth.value)
+ .format("YYYY-MM")
+ : "";
break;
default:
dayjsVal =
@@ -177,10 +216,10 @@ const getDateValue = () => {
: "";
break;
}
- dateValue.value = dayjsVal!=='Invalid Date'?dayjsVal:'';
- if (dayjsVal === 'Invalid Date') {
+ dateValue.value = dayjsVal !== "Invalid Date" ? dayjsVal : "";
+ if (dayjsVal === "Invalid Date") {
unWatch = false;
- $emits("update:modelValue", '');
+ $emits("update:modelValue", "");
return;
}
$emits("update:modelValue", dayjsVal);
@@ -268,14 +307,13 @@ watch(
hms.value.mm = dayjs(modelValue).minute();
hms.value.ss = dayjs(modelValue).second();
}
- currentYear.value = initModelValue?getYear(initModelValue):-1;
- currentMonth.value = initModelValue?getMonth(initModelValue):-1;
- currentDay.value = initModelValue?getDay(initModelValue):-1;
- if (props.type === 'date' || props.type === 'datetime') { // date与datetime容错
- if (currentYear.value === -1)
- currentYear.value = dayjs().year();
- if (currentMonth.value === -1)
- currentMonth.value = dayjs().month();
+ currentYear.value = initModelValue ? getYear(initModelValue) : -1;
+ currentMonth.value = initModelValue ? getMonth(initModelValue) : -1;
+ currentDay.value = initModelValue ? getDay(initModelValue) : -1;
+ if (props.type === "date" || props.type === "datetime") {
+ // date与datetime容错
+ if (currentYear.value === -1) currentYear.value = dayjs().year();
+ if (currentMonth.value === -1) currentMonth.value = dayjs().month();
}
rangeValue.first = initModelValue;
rangeValue.last =
@@ -291,12 +329,12 @@ watch(
{ immediate: true }
);
-const onChange=()=>{
+const onChange = () => {
if (dropdownRef.value)
// @ts-ignore
dropdownRef.value.hide();
- $emits('update:modelValue',dateValue.value)
-}
+ $emits("update:modelValue", dateValue.value);
+};
provide("datePicker", {
currentYear: currentYear,
diff --git a/package/component/src/component/table/index.vue b/package/component/src/component/table/index.vue
index 76fd0e9f..afb21416 100644
--- a/package/component/src/component/table/index.vue
+++ b/package/component/src/component/table/index.vue
@@ -72,7 +72,9 @@ const tableSelectedKeys = ref([...props.selectedKeys]);
const tableColumns = ref([...props.columns]);
const tableColumnKeys = ref(
props.columns.map((item: any) => {
- return item.key;
+ if(item.hide != true) {
+ return item.key;
+ }
})
);
@@ -349,12 +351,14 @@ const renderFixedClassName = (column: any, columnIndex: number) => {
-
+
+
+
@@ -442,12 +446,14 @@ const renderFixedClassName = (column: any, columnIndex: number) => {
-
+
+
+
diff --git a/package/document-component/src/document/zh-CN/components/table.md b/package/document-component/src/document/zh-CN/components/table.md
index 2584be7b..1c2de3cd 100644
--- a/package/document-component/src/document/zh-CN/components/table.md
+++ b/package/document-component/src/document/zh-CN/components/table.md
@@ -220,110 +220,6 @@ export default {
:::
-::: title 完整表格
-:::
-
-::: demo
-
-
-
-
- 新增
- 删除
-
- {{data.username}}
- 😊
- {{data.password}}
-
- 修改
- 删除
-
-
-
- 内容
-
-
-
-
-
-
-
-:::
-
::: title 开启子表
:::
@@ -781,6 +677,121 @@ export default {
:::
+::: title 完整表格
+:::
+
+::: demo
+
+
+
+
+ 新增
+ 删除
+
+ {{data.name}}
+ 😊
+ {{data.birthday}}
+
+ 修改
+ 删除
+
+
+
+ 内容
+
+
+
+
+
+
+
+:::
+
::: title Table 属性
:::