Skip to content

Failed to resolve component: VxeNumberInput,VxeUI.component干啥用的来着? #5782

Closed as not planned
@lovelyJason

Description

@lovelyJason

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. 按需导入
  3. 局部导入

其中1,2没什么好说的,局部导入是从vxe-pc-ui和vxe-table中导入组件,然后被vue app use使用
3的局部导入,文档有说明:

         // 注册组件
        // 如果页面中已经被显性导入了,则可以不用调用注册
        // 如果是配置式的,没有在页面中显性导入,则需要逐个注册
        VxeUI.component(VxeAlert)

但是实际上并没有效果好像。我使用vxe-table的原生标签直接使用editRender: { name: 'VxeNumberInput' },

这个是不是vxe table的一个bug或者说使用问题?谁有经验的,VxeUI.component函数是干啥用的来着?

Image

必须得使用vue的app.use才能支持在配置式写法中使用
editRender: { name: 'VxeNumberInput' }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions