diff --git a/yudao-ui-admin-vue3/src/plugins/vxeTable/renderer/default.tsx b/yudao-ui-admin-vue3/src/plugins/vxeTable/renderer/default.tsx new file mode 100644 index 000000000..ec30646d5 --- /dev/null +++ b/yudao-ui-admin-vue3/src/plugins/vxeTable/renderer/default.tsx @@ -0,0 +1,32 @@ +import { VXETable } from 'vxe-table' + +// 超链接渲染 +VXETable.renderer.add('XLink', { + // 默认显示模板 + renderDefault(renderOpts, params) { + const { row, column } = params + const { events = {} } = renderOpts + return ( + events.click(params)}> + {row[column.field]} + + ) + } +}) + +// 图片渲染 +VXETable.renderer.add('XImg', { + // 默认显示模板 + renderDefault(_renderOpts, params) { + const { row, column } = params + return ( + + ) + } +}) diff --git a/yudao-ui-admin-vue3/src/plugins/vxeTable/renderer/index.tsx b/yudao-ui-admin-vue3/src/plugins/vxeTable/renderer/index.tsx index 22381573e..50a41bcbb 100644 --- a/yudao-ui-admin-vue3/src/plugins/vxeTable/renderer/index.tsx +++ b/yudao-ui-admin-vue3/src/plugins/vxeTable/renderer/index.tsx @@ -1,2 +1,3 @@ import './dataTimePicker' import './dict' +import './default'