Skip to content

Commit

Permalink
chore: fix typo (#222)
Browse files Browse the repository at this point in the history
Co-authored-by: pany <[email protected]>
  • Loading branch information
ijliym and pany-ang authored Dec 3, 2024
1 parent 50d862d commit 52a5cb8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
9 changes: 5 additions & 4 deletions src/views/table/vxe-table/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -31,6 +31,7 @@ interface RowMeta {
/** vxe-table 自动添加上去的属性 */
_VXE_ID?: string
}
const xGridDom = ref<VxeGridInstance>()
const xGridOpt: VxeGridProps = reactive({
loading: true,
Expand Down Expand Up @@ -96,7 +97,7 @@ const xGridOpt: VxeGridProps = reactive({
field: "roles",
title: "角色",
/** 自定义列与 type: "html" 的列一起使用,会产生错误,所以采用 TSX 实现 */
slots: RoleColumnSolts
slots: RoleColumnSlots
},
{
field: "phone",
Expand All @@ -109,7 +110,7 @@ const xGridOpt: VxeGridProps = reactive({
{
field: "status",
title: "状态",
slots: StatusColumnSolts
slots: StatusColumnSlots
},
{
field: "createTime",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
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"
return [<span class={`el-tag el-tag--${type} el-tag--plain`}>{cellValue}</span>]
}
}

export default solts
export default slots
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
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", "禁用"]
return [<span class={`el-tag el-tag--${type} el-tag--plain`}>{value}</span>]
}
}

export default solts
export default slots

0 comments on commit 52a5cb8

Please sign in to comment.