From 313a01fd19fd646ab432415c1e27696432b0de0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Mon, 6 May 2019 16:43:24 +0800 Subject: [PATCH] rm dev script --- package.json | 3 +-- src/global.less | 5 ----- src/models/setting.ts | 9 +++++++-- tslint.yml | 2 ++ 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index a33e49fd..5004028e 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,6 @@ "scripts": { "analyze": "cross-env ANALYZE=1 umi build", "build": "umi build && npm run functions:build", - "dev": "cross-env APP_TYPE=site umi dev", - "dev:no-mock": "cross-env MOCK=none umi dev", "docker-hub:build": "docker build -f Dockerfile.hub -t ant-design-pro ./", "docker-prod:build": "docker-compose -f ./docker/docker-compose.yml build", "docker-prod:dev": "docker-compose -f ./docker/docker-compose.yml up", @@ -82,6 +80,7 @@ "react-media": "^1.9.2", "react-media-hook2": "^1.0.2", "umi": "^2.6.10", + "umi-plugin-pro-block": "^1.3.0", "umi-plugin-react": "^1.7.2", "umi-request": "^1.0.5" }, diff --git a/src/global.less b/src/global.less index 1450ba46..dfc17df0 100644 --- a/src/global.less +++ b/src/global.less @@ -24,11 +24,6 @@ body { -moz-osx-font-smoothing: grayscale; } -.globalSpin { - width: 100%; - margin: 40px 0 !important; -} - ul, ol { list-style: none; diff --git a/src/models/setting.ts b/src/models/setting.ts index 6b8e0e67..b7f9068e 100644 --- a/src/models/setting.ts +++ b/src/models/setting.ts @@ -14,7 +14,8 @@ let lessNodesAppended: boolean; const updateTheme: (primaryColor?: string) => void = primaryColor => { // Don't compile less in production! - // preview.pro.ant.design only do not use in your production ; preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。 + // preview.pro.ant.design only do not use in your production; + // preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。 if (ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION !== 'site') { return; } @@ -72,7 +73,10 @@ const updateTheme: (primaryColor?: string) => void = primaryColor => { }; const updateColorWeak: (colorWeak: string) => void = colorWeak => { - document.body.className = colorWeak ? 'colorWeak' : ''; + const root = document.getElementById('root'); + if (root) { + root.className = colorWeak ? 'colorWeak' : ''; + } }; const SettingModel: SettingModelType = { @@ -89,6 +93,7 @@ const SettingModel: SettingModelType = { } }); const { primaryColor, colorWeak } = setting; + if (state.primaryColor !== primaryColor) { updateTheme(primaryColor); } diff --git a/tslint.yml b/tslint.yml index a3e95faf..3c7841ec 100644 --- a/tslint.yml +++ b/tslint.yml @@ -1,4 +1,6 @@ defaultSeverity: error +globals: + - ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: true extends: - tslint-react - tslint-eslint-rules -- GitLab