"proxy": "http://localhost:6000"
当我添加 package.json时,我在项目中遇到了这个错误。
这是纱线启动后的错误响应。
选项对象无效。开发服务器已使用与 API 架构不匹配的选项对象进行初始化。
- options.allowedHosts[0] 应该是一个非空字符串。error 命令失败,退出代码 1。 info 请访问 https://yarnpkg.com/en/docs/cli/run以获取有关此命令的文档。
但当我删除后一切都很好"proxy": "http://localhost:6000"。
这是我的 package.json 上的:
{
"name": "client",
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "^4.12.3",
"@testing-library/jest-dom": "^5.16.1",
"@testing-library/react": "^12.1.2",
"@testing-library/user-event": "^13.5.0",
"axios": "^0.24.0",
"moment": "^2.29.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-file-base64": "^1.0.3",
"react-redux": "^7.2.6",
"react-scripts": "5.0.0",
"redux": "^4.1.2",
"redux-thunk": "^2.4.1",
"web-vitals": "^2.1.2"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [ …Run Code Online (Sandbox Code Playgroud) 我想知道为什么顺风管理模板不起作用,后来我发现我的 app.css 中不存在某些类。
我按照https://tailwindcss.com/docs/guides/laravel中的安装进行操作。
这些是我的 app.css 中的类。
为什么有些类不存在于 app.css 中?例如:bg-gray-800、w-full、h-20 等。
/*
! tailwindcss v3.0.22 | MIT License | https://tailwindcss.com
*//*
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
*/
*,
::before,
::after {
box-sizing: border-box; /* 1 */
border-width: 0; /* 2 */
border-style: solid; /* 2 */
border-color: #e5e7eb; /* 2 */
}
::before,
::after {
--tw-content: '';
}
/*
1. …Run Code Online (Sandbox Code Playgroud)我很难在 DataGrid 组件中的每行添加自定义按钮。
这是我的代码:
const columns = [
{ field: 'model_id', headerName: 'ID', width: 70, sortable: false },
{ field: 'model_code', headerName: 'Model Code', width: 130 },
{ field: 'model_description', headerName: 'Description', width: 400 },
{ field: 'actions', headerName: 'Actions', width: 400 }
];
Run Code Online (Sandbox Code Playgroud)
数据网格:
<DataGrid
rows={models}
columns={columns}
getRowId={(row) => row.model_id}
pageSize={5}
rowsPerPageOptions={[5]}
checkboxSelection />
Run Code Online (Sandbox Code Playgroud)