Skip to content

Commit

Permalink
✨ feat: add react-dev-inspector plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshuai2144 committed Dec 8, 2020
1 parent f0344c4 commit 818926f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
8 changes: 8 additions & 0 deletions config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,12 @@ export default defineConfig({
basePath: '/',
},
esbuild: {},
// https://github.com/zthxxx/react-dev-inspector
plugins: ['react-dev-inspector/plugins/umi/react-inspector'],
inspectorConfig: {
// loader options type and docs see below
exclude: [],
babelPlugins: [],
babelOptions: {},
},
});
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ant-design-pro",
"version": "4.4.0",
"version": "4.5.0",
"private": true,
"description": "An out-of-box UI solution for enterprise applications",
"scripts": {
Expand Down Expand Up @@ -66,6 +66,7 @@
"omit.js": "^2.0.2",
"qs": "^6.9.0",
"react": "^17.0.0",
"react-dev-inspector": "^1.1.1",
"react-dom": "^17.0.0",
"react-helmet-async": "^1.0.4",
"umi": "^3.2.14",
Expand Down
6 changes: 3 additions & 3 deletions src/pages/ListTableList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React, { useState, useRef } from 'react';
import { useIntl, FormattedMessage } from 'umi';
import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
import ProTable, { ProColumns, ActionType } from '@ant-design/pro-table';
import ProDescriptions from '@ant-design/pro-descriptions';
import ProDescriptions, { ProDescriptionsItemProps } from '@ant-design/pro-descriptions';
import CreateForm from './components/CreateForm';
import UpdateForm, { FormValueType } from './components/UpdateForm';
import { TableListItem } from './data.d';
Expand Down Expand Up @@ -214,7 +214,7 @@ const TableList: React.FC<{}> = () => {
labelWidth: 120,
}}
toolBarRender={() => [
<Button type="primary" onClick={() => handleModalVisible(true)}>
<Button type="primary" key="primary" onClick={() => handleModalVisible(true)}>
<PlusOutlined /> <FormattedMessage id="pages.searchTable.new" defaultMessage="新建" />
</Button>,
]}
Expand Down Expand Up @@ -312,7 +312,7 @@ const TableList: React.FC<{}> = () => {
params={{
id: row?.name,
}}
columns={columns}
columns={columns as ProDescriptionsItemProps<TableListItem>[]}
/>
)}
</Drawer>
Expand Down

0 comments on commit 818926f

Please sign in to comment.