Closed as not planned
Description
vben5: 5.4.2
vxe-table: ^4.7.93
vxe-pc-ui: ^4.2.26
同这个issue: #5478
在Grid的配置式写法中,
const gridOptions: VxeGridProps<RowType> = {
border: true,
editConfig: {
trigger: 'click',
mode: 'row',
},
columns: [
{
field: 'money',
title: '金额',
width: 180,
editRender: { name: 'VxeNumberInput' },
},
{ align: 'left', slots: { default: 'action' }, title: '操作' },
],
keepSource: true,
pagerConfig: {
enabled: false,
autoHidden: true,
},
};
这种会报错
Failed to resolve component: VxeNumberInput
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
我参考了官方文档的https://vxeui.com/o#/start/useImport
的vxe ui的三种导入方式
- 全局导入
- 按需导入
- 局部导入
其中1,2没什么好说的,局部导入是从vxe-pc-ui和vxe-table中导入组件,然后被vue app use使用
3的局部导入,文档有说明:
// 注册组件
// 如果页面中已经被显性导入了,则可以不用调用注册
// 如果是配置式的,没有在页面中显性导入,则需要逐个注册
VxeUI.component(VxeAlert)
但是实际上并没有效果好像。我使用vxe-table的原生标签直接使用editRender: { name: 'VxeNumberInput' },
这个是不是vxe table的一个bug或者说使用问题?谁有经验的,VxeUI.component函数是干啥用的来着?
必须得使用vue的app.use才能支持在配置式写法中使用
editRender: { name: 'VxeNumberInput' }
Metadata
Metadata
Assignees
Labels
No labels