📝(table): update
This commit is contained in:
parent
876947c79e
commit
7f67012f13
@ -107,14 +107,7 @@ import { LayIcon } from "@layui/icons-vue";
|
|||||||
import LayInput from "../input/index.vue";
|
import LayInput from "../input/index.vue";
|
||||||
import LayDropdown from "../dropdown/index.vue";
|
import LayDropdown from "../dropdown/index.vue";
|
||||||
import { getMonth, getYear, getDay } from "./day";
|
import { getMonth, getYear, getDay } from "./day";
|
||||||
import {
|
import { ref, watch, defineProps, defineEmits, reactive, provide } from "vue";
|
||||||
ref,
|
|
||||||
watch,
|
|
||||||
defineProps,
|
|
||||||
defineEmits,
|
|
||||||
reactive,
|
|
||||||
provide,
|
|
||||||
} from "vue";
|
|
||||||
import DatePanel from "./components/DatePanel.vue";
|
import DatePanel from "./components/DatePanel.vue";
|
||||||
import TimePanel from "./components/TimePanel.vue";
|
import TimePanel from "./components/TimePanel.vue";
|
||||||
import YearPanel from "./components/YearPanel.vue";
|
import YearPanel from "./components/YearPanel.vue";
|
||||||
|
@ -321,27 +321,27 @@ const renderFixedClassName = (column: any, columnIndex: number) => {
|
|||||||
|
|
||||||
const hasTotalRow = computed(() => {
|
const hasTotalRow = computed(() => {
|
||||||
let b = false;
|
let b = false;
|
||||||
props.columns.forEach(item => {
|
props.columns.forEach((item) => {
|
||||||
if(item.totalRow) {
|
if (item.totalRow) {
|
||||||
b = true;
|
b = true;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
return b;
|
return b;
|
||||||
})
|
});
|
||||||
|
|
||||||
const renderTotalRowCell = (column: any) => {
|
const renderTotalRowCell = (column: any) => {
|
||||||
if(column.totalRow) {
|
if (column.totalRow) {
|
||||||
if(column.totalRow != true) {
|
if (column.totalRow != true) {
|
||||||
return column.totalRow;
|
return column.totalRow;
|
||||||
} else {
|
} else {
|
||||||
let total = 0;
|
let total = 0;
|
||||||
tableDataSource.value.forEach(item => {
|
tableDataSource.value.forEach((item) => {
|
||||||
total = total + item[column.key];
|
total = total + item[column.key];
|
||||||
})
|
});
|
||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -912,10 +912,10 @@ export default {
|
|||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
::: title 合并列值
|
::: title 开启统计
|
||||||
:::
|
:::
|
||||||
|
|
||||||
::: demo 通过 `columns` 配置 `type:'number'` 开启序号列。
|
::: demo 通过 `columns` 配置 `totalRow` 开启行统计。
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<lay-table :columns="columns26" :dataSource="dataSource26"></lay-table>
|
<lay-table :columns="columns26" :dataSource="dataSource26"></lay-table>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user