mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-27 01:32:03 +08:00
perf: vxe renderer
This commit is contained in:
parent
886bc6eacd
commit
7b2871ac72
10
yudao-ui-admin-vue3/src/plugins/vxeTable/renderer/html.tsx
Normal file
10
yudao-ui-admin-vue3/src/plugins/vxeTable/renderer/html.tsx
Normal file
@ -0,0 +1,10 @@
|
||||
import { VXETable } from 'vxe-table'
|
||||
|
||||
// 图片渲染
|
||||
VXETable.renderer.add('XHtml', {
|
||||
// 默认显示模板
|
||||
renderDefault(_renderOpts, params) {
|
||||
const { row, column } = params
|
||||
return <span v-html={row[column.field]}></span>
|
||||
}
|
||||
})
|
@ -1,19 +1,5 @@
|
||||
import { VXETable } from 'vxe-table'
|
||||
|
||||
// 超链接渲染
|
||||
VXETable.renderer.add('XLink', {
|
||||
// 默认显示模板
|
||||
renderDefault(renderOpts, params) {
|
||||
const { row, column } = params
|
||||
const { events = {} } = renderOpts
|
||||
return (
|
||||
<a class="link" onClick={() => events.click(params)}>
|
||||
{row[column.field]}
|
||||
</a>
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
// 图片渲染
|
||||
VXETable.renderer.add('XImg', {
|
||||
// 默认显示模板
|
@ -1,3 +1,4 @@
|
||||
import './dataTimePicker'
|
||||
import './dict'
|
||||
import './default'
|
||||
import './link'
|
||||
import './img'
|
||||
|
15
yudao-ui-admin-vue3/src/plugins/vxeTable/renderer/link.tsx
Normal file
15
yudao-ui-admin-vue3/src/plugins/vxeTable/renderer/link.tsx
Normal file
@ -0,0 +1,15 @@
|
||||
import { VXETable } from 'vxe-table'
|
||||
|
||||
// 超链接渲染
|
||||
VXETable.renderer.add('XLink', {
|
||||
// 默认显示模板
|
||||
renderDefault(renderOpts, params) {
|
||||
const { row, column } = params
|
||||
const { events = {} } = renderOpts
|
||||
return (
|
||||
<a class="link" onClick={() => events.click(params)}>
|
||||
{row[column.field]}
|
||||
</a>
|
||||
)
|
||||
}
|
||||
})
|
Loading…
Reference in New Issue
Block a user