From 52a5cb8dc65fa74544e9087779f1aebdede07775 Mon Sep 17 00:00:00 2001 From: liym <43025881+ijliym@users.noreply.github.com> Date: Tue, 3 Dec 2024 14:27:23 +0800 Subject: [PATCH] chore: fix typo (#222) Co-authored-by: pany <939630029@qq.com> --- src/views/table/vxe-table/index.vue | 9 +++++---- .../tsx/{RoleColumnSolts.tsx => RoleColumnSlots.tsx} | 4 ++-- .../tsx/{StatusColumnSolts.tsx => StatusColumnSlots.tsx} | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) rename src/views/table/vxe-table/tsx/{RoleColumnSolts.tsx => RoleColumnSlots.tsx} (82%) rename src/views/table/vxe-table/tsx/{StatusColumnSolts.tsx => StatusColumnSlots.tsx} (83%) diff --git a/src/views/table/vxe-table/index.vue b/src/views/table/vxe-table/index.vue index c00b2197..40d2c88d 100644 --- a/src/views/table/vxe-table/index.vue +++ b/src/views/table/vxe-table/index.vue @@ -3,8 +3,8 @@ import { nextTick, reactive, ref } from "vue" import { type ElMessageBoxOptions, ElMessageBox, ElMessage } from "element-plus" import { deleteTableDataApi, getTableDataApi } from "@/api/table" import { type TableResponseData } from "@/api/table/types/table" -import RoleColumnSolts from "./tsx/RoleColumnSolts" -import StatusColumnSolts from "./tsx/StatusColumnSolts" +import RoleColumnSlots from "./tsx/RoleColumnSlots" +import StatusColumnSlots from "./tsx/StatusColumnSlots" import { type VxeGridInstance, type VxeGridProps, @@ -31,6 +31,7 @@ interface RowMeta { /** vxe-table 自动添加上去的属性 */ _VXE_ID?: string } + const xGridDom = ref() const xGridOpt: VxeGridProps = reactive({ loading: true, @@ -96,7 +97,7 @@ const xGridOpt: VxeGridProps = reactive({ field: "roles", title: "角色", /** 自定义列与 type: "html" 的列一起使用,会产生错误,所以采用 TSX 实现 */ - slots: RoleColumnSolts + slots: RoleColumnSlots }, { field: "phone", @@ -109,7 +110,7 @@ const xGridOpt: VxeGridProps = reactive({ { field: "status", title: "状态", - slots: StatusColumnSolts + slots: StatusColumnSlots }, { field: "createTime", diff --git a/src/views/table/vxe-table/tsx/RoleColumnSolts.tsx b/src/views/table/vxe-table/tsx/RoleColumnSlots.tsx similarity index 82% rename from src/views/table/vxe-table/tsx/RoleColumnSolts.tsx rename to src/views/table/vxe-table/tsx/RoleColumnSlots.tsx index 9d95f942..e34af982 100644 --- a/src/views/table/vxe-table/tsx/RoleColumnSolts.tsx +++ b/src/views/table/vxe-table/tsx/RoleColumnSlots.tsx @@ -1,6 +1,6 @@ import { type VxeColumnPropTypes } from "vxe-table/types/column" -const solts: VxeColumnPropTypes.Slots = { +const slots: VxeColumnPropTypes.Slots = { default: ({ row, column }) => { const cellValue = row[column.field] const type = cellValue === "admin" ? "primary" : "warning" @@ -8,4 +8,4 @@ const solts: VxeColumnPropTypes.Slots = { } } -export default solts +export default slots diff --git a/src/views/table/vxe-table/tsx/StatusColumnSolts.tsx b/src/views/table/vxe-table/tsx/StatusColumnSlots.tsx similarity index 83% rename from src/views/table/vxe-table/tsx/StatusColumnSolts.tsx rename to src/views/table/vxe-table/tsx/StatusColumnSlots.tsx index 125263ca..3bf4d42f 100644 --- a/src/views/table/vxe-table/tsx/StatusColumnSolts.tsx +++ b/src/views/table/vxe-table/tsx/StatusColumnSlots.tsx @@ -1,6 +1,6 @@ import { type VxeColumnPropTypes } from "vxe-table/types/column" -const solts: VxeColumnPropTypes.Slots = { +const slots: VxeColumnPropTypes.Slots = { default: ({ row, column }) => { const cellValue = row[column.field] const [type, value] = cellValue ? ["success", "启用"] : ["danger", "禁用"] @@ -8,4 +8,4 @@ const solts: VxeColumnPropTypes.Slots = { } } -export default solts +export default slots