我一直在尝试在Adminjs 6.6.5 Jmeter 板中制作自定义组件,但Adminjs ComponentLoader未找到错误发生。然后我尝试
import AdminJS from 'adminjs'
const {ComponentLoader} = AdminJS
但我得到:尝试捆绑文件“file:/Users/Josip/WebstormProjects/ferry-backend/components/dashboard.jsx”,但它不存在
我真的很感激你的帮助...
admin/index.js
import {ComponentLoader} from "adminjs";
const componentLoader = new ComponentLoader()
const Components = {
MyDashboard: componentLoader.override('Dashboard','../components/dashboard.jsx')
}
export { componentLoader, Components }
index.js
import {componentLoader, Components} from "./admin/index.js";
AdminJS.registerAdapter(AdminJSSequelize)
const admin = new AdminJS({
databases: [],
rootPath: '/admin',
resources:[UsersResources, GuestResources, SalesResources, FinancesResources],
components:{
edit: Components.MyDashboard
},
componentLoader
})
2条答案
按热度按时间rjee0c151#
你解决了这个问题吗?我也遇到了这个问题,不知道怎么解决
3zwjbxry2#
我修复了这个问题。你需要做的导入如下
我的用法示例:
祝您的发展顺利!