Closed qq1066536 closed 2 years ago
<template> <el-form :ref="formRef" :model="form" :rules="rules" size="small" :validate-on-rule-change="false"> <el-row> <el-col v-for="column in columns" v-bind="response" :key="column.prop"> <el-form-item :label="column.label" :prop="column.prop"> <component :is="column.component" /> </el-form-item> </el-col> </el-row> </el-form> </template> <script setup lang='ts'> import { reactive} from "vue" const columns = reactive([ { prop: 'userName', label: '用户名', component: 'el-input', }, ]); </script>
vue
component
新增includes 属性或者类型于unplugin-auto-import 中的imports 属性,自动导入指定的组件
unplugin-auto-import
No response
Same problem. Hope to fix it soon
Please use https://github.com/antfu/unplugin-auto-import, and do not use string literal 'el-input', use ElInput variable instead.
'el-input'
ElInput
Clear and concise description of the problem
使用
vue
自带component
组件,生成动态组件时,按需加载无法正常加载,需要手动导入组件和样式Suggested solution
新增includes 属性或者类型于
unplugin-auto-import
中的imports 属性,自动导入指定的组件Alternative
No response
Additional context
No response
Validations