feat: add renderIcon
parent
3274f757b9
commit
2f284d31c3
|
@ -1,4 +1,5 @@
|
|||
import { DictTag } from '@/components/DictTag'
|
||||
import Icon from '@/components/Icon'
|
||||
import { Image, Tag } from 'ant-design-vue'
|
||||
import dayjs from 'dayjs'
|
||||
import { h } from 'vue'
|
||||
|
@ -58,5 +59,10 @@ export const useRender = {
|
|||
})
|
||||
}
|
||||
return ''
|
||||
},
|
||||
renderIcon: (text) => {
|
||||
if (text) {
|
||||
return h(Icon, { icon: text })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
import Icon from '@/components/Icon'
|
||||
import { listSimpleMenus } from '@/api/system/menu'
|
||||
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
|
||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||
import { SystemMenuTypeEnum } from '@/enums/systemEnum'
|
||||
import { h } from 'vue'
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
|
@ -25,7 +23,7 @@ export const columns: BasicColumn[] = [
|
|||
dataIndex: 'icon',
|
||||
width: 60,
|
||||
customRender: ({ record }) => {
|
||||
return h(Icon, { icon: record.icon })
|
||||
return useRender.renderIcon(record.icon)
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue