Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ant-design-pro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
ant-design-pro
Commits
6efffad5
Commit
6efffad5
authored
Aug 28, 2018
by
afc163
Committed by
陈帅
Aug 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do not compile less in production
parent
d1144e44
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
14 deletions
+17
-14
src/components/SettingDrawer/index.js
src/components/SettingDrawer/index.js
+7
-10
src/components/SettingDrawer/index.less
src/components/SettingDrawer/index.less
+1
-1
src/layouts/BasicLayout.js
src/layouts/BasicLayout.js
+3
-1
src/locales/zh-CN.js
src/locales/zh-CN.js
+2
-2
src/models/setting.js
src/models/setting.js
+4
-0
No files found.
src/components/SettingDrawer/index.js
View file @
6efffad5
import
React
,
{
PureComponent
}
from
'
react
'
;
import
{
Select
,
message
,
Drawer
,
List
,
Switch
,
Divider
,
Icon
,
Button
}
from
'
antd
'
;
import
{
Select
,
message
,
Drawer
,
List
,
Switch
,
Divider
,
Icon
,
Button
,
Alert
}
from
'
antd
'
;
import
{
formatMessage
}
from
'
umi/locale
'
;
import
{
CopyToClipboard
}
from
'
react-copy-to-clipboard
'
;
import
{
connect
}
from
'
dva
'
;
...
...
@@ -215,18 +215,15 @@ class SettingDrawer extends PureComponent {
text
=
{
JSON
.
stringify
(
setting
)}
onCopy
=
{()
=>
message
.
success
(
formatMessage
({
id
:
'
app.setting.copyinfo
'
}))}
>
<
Button
style
=
{{
width
:
224
,
}}
>
<
Icon
type
=
"
copy
"
/>
<
Button
block
icon
=
"
copy
"
>
{
formatMessage
({
id
:
'
app.setting.copy
'
})}
<
/Button
>
<
/CopyToClipboard
>
<
div
className
=
{
styles
.
productionHint
}
>
{
formatMessage
({
id
:
'
app.setting.production.hint
'
})}
<
/div
>
<
Alert
type
=
"
warning
"
className
=
{
styles
.
productionHint
}
message
=
{
formatMessage
({
id
:
'
app.setting.production.hint
'
})}
/
>
<
/div
>
<
/Drawer
>
);
...
...
src/components/SettingDrawer/index.less
View file @
6efffad5
...
...
@@ -71,5 +71,5 @@
.productionHint {
font-size: 12px;
color: @text-color-secondary;
margin-top:
8
px;
margin-top:
16
px;
}
src/layouts/BasicLayout.js
View file @
6efffad5
...
...
@@ -202,7 +202,9 @@ class BasicLayout extends React.PureComponent {
)}
<
/ContainerQuery
>
<
/DocumentTitle
>
{
this
.
state
.
rendering
?
null
:
<
SettingDrawer
/>
}
{
this
.
state
.
rendering
&&
process
.
env
.
NODE_ENV
===
'
production
'
?
null
:
(
// Do show SettingDrawer in production
<
SettingDrawer
/>
)}
<
/React.Fragment
>
);
}
...
...
src/locales/zh-CN.js
View file @
6efffad5
...
...
@@ -162,6 +162,6 @@ export default {
'
app.setting.othersettings
'
:
'
其他设置
'
,
'
app.setting.weakmode
'
:
'
色弱模式
'
,
'
app.setting.copy
'
:
'
拷贝设置
'
,
'
app.setting.copyinfo
'
:
'
拷贝成功,请到 src/defaultSetting.js 中替换
'
,
'
app.setting.production.hint
'
:
'
设置
侧边栏只会出现在开发环境,请手动配置
src/defaultSetting.js
'
,
'
app.setting.copyinfo
'
:
'
拷贝成功,请到 src/defaultSetting.js 中替换
默认配置
'
,
'
app.setting.production.hint
'
:
'
设置
栏只用于开发环境预览,请拷贝后手动修改
src/defaultSetting.js
'
,
};
src/models/setting.js
View file @
6efffad5
...
...
@@ -3,6 +3,10 @@ import defaultSetting from '../defaultSetting';
let
lessNodesAppended
;
const
updateTheme
=
primaryColor
=>
{
// Don't compile less in production!
if
(
process
.
env
.
NODE_ENV
===
'
production
'
)
{
return
;
}
// Determine if the component is remounted
if
(
!
primaryColor
)
{
return
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment