我正在使用 admin-bro 和express js,在我看来一切都工作正常,直到我尝试添加自定义组件来更改资源的输入字段。以下是我正在使用的代码。
编辑LogoField.jsx
const React = require('react');
class EditLogoField extends React.PureComponent {
render() {
return (
<input type='file'/>
);
}
}
module.exports = EditLogoField;
Run Code Online (Sandbox Code Playgroud)
我想像这样使用它
const AdminBro = require('admin-bro');
module.exports = {
properties: {
logo: {
type: 'string',
isVisible: {
list: false,
edit: true,
filter: false,
show: true,
},
components: {
edit: AdminBro.bundle('../components/serviceProviderCompany/EditLogoField')
}
},
},
};
Run Code Online (Sandbox Code Playgroud)
我得到的只是这个
有同样的问题。花了一整天的时间试图解决它。在 Windows 和 Ubuntu 系统上构建均失败。我的项目文件夹路径有一个“.” 'C:\.code\Projects' 中的符号最近也导致了 Unity 项目的一些问题。
解决方案:
move project into a folder that doesn't have a '.' symbol in its path.
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1186 次 |
| 最近记录: |