perf: vxe renderer

This commit is contained in:
xingyu4j 2022-11-22 14:56:29 +08:00
parent 886bc6eacd
commit 7b2871ac72
4 changed files with 27 additions and 15 deletions

View 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>
}
})

View File

@ -1,19 +1,5 @@
import { VXETable } from 'vxe-table' 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', { VXETable.renderer.add('XImg', {
// 默认显示模板 // 默认显示模板

View File

@ -1,3 +1,4 @@
import './dataTimePicker' import './dataTimePicker'
import './dict' import './dict'
import './default' import './link'
import './img'

View 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>
)
}
})