@@ -186,8 +186,7 @@ export default {
186
186
data () {
187
187
return {
188
188
visible: true ,
189
- colorList,
190
- baseConfig: Object .assign ({}, config)
189
+ colorList
191
190
}
192
191
},
193
192
watch: {
@@ -217,29 +216,27 @@ export default {
217
216
this .visible = ! this .visible
218
217
},
219
218
onColorWeak (checked ) {
220
- this .baseConfig .colorWeak = checked
221
219
this .$store .dispatch (' ToggleWeak' , checked)
222
220
updateColorWeak (checked)
223
221
},
224
222
onMultiTab (checked ) {
225
- this .baseConfig .multiTab = checked
226
223
this .$store .dispatch (' ToggleMultiTab' , checked)
227
224
},
228
225
handleMenuTheme (theme ) {
229
- this .baseConfig .navTheme = theme
230
226
this .$store .dispatch (' ToggleTheme' , theme)
231
227
},
232
228
doCopy () {
229
+ // get current settings from mixin or this.$store.state.app, pay attention to the property name
233
230
const text = ` export default {
234
- primaryColor: '${ this .baseConfig . primaryColor } ', // primary color of ant design
235
- navTheme: '${ this .baseConfig . navTheme } ', // theme for nav menu
236
- layout: '${ this .baseConfig . layout } ', // nav menu position: sidemenu or topmenu
237
- contentWidth: '${ this .baseConfig . contentWidth } ', // layout of content: Fluid or Fixed, only works when layout is topmenu
238
- fixedHeader: ${ this .baseConfig . fixedHeader } , // sticky header
239
- fixSiderbar: ${ this .baseConfig . fixSiderbar } , // sticky siderbar
240
- autoHideHeader: ${ this .baseConfig . autoHideHeader } , // auto hide header
241
- colorWeak: ${ this .baseConfig . colorWeak } ,
242
- multiTab: ${ this .baseConfig . multiTab } ,
231
+ primaryColor: '${ this .primaryColor } ', // primary color of ant design
232
+ navTheme: '${ this .navTheme } ', // theme for nav menu
233
+ layout: '${ this .layoutMode } ', // nav menu position: sidemenu or topmenu
234
+ contentWidth: '${ this .contentWidth } ', // layout of content: Fluid or Fixed, only works when layout is topmenu
235
+ fixedHeader: ${ this .fixedHeader } , // sticky header
236
+ fixSiderbar: ${ this .fixSiderbar } , // sticky siderbar
237
+ autoHideHeader: ${ this .autoHideHeader } , // auto hide header
238
+ colorWeak: ${ this .colorWeak } ,
239
+ multiTab: ${ this .multiTab } ,
243
240
production: process.env.NODE_ENV === 'production' && process.env.VUE_APP_PREVIEW !== 'true',
244
241
// vue-ls options
245
242
storageOptions: {
@@ -257,38 +254,30 @@ export default {
257
254
})
258
255
},
259
256
handleLayout (mode ) {
260
- this .baseConfig .layout = mode
261
257
this .$store .dispatch (' ToggleLayoutMode' , mode)
262
258
// 因为顶部菜单不能固定左侧菜单栏,所以强制关闭
263
- //
264
259
this .handleFixSiderbar (false )
265
260
},
266
261
handleContentWidthChange (type ) {
267
- this .baseConfig .contentWidth = type
268
262
this .$store .dispatch (' ToggleContentWidth' , type)
269
263
},
270
264
changeColor (color ) {
271
- this .baseConfig .primaryColor = color
272
265
if (this .primaryColor !== color) {
273
266
this .$store .dispatch (' ToggleColor' , color)
274
267
updateTheme (color)
275
268
}
276
269
},
277
270
handleFixedHeader (fixed ) {
278
- this .baseConfig .fixedHeader = fixed
279
271
this .$store .dispatch (' ToggleFixedHeader' , fixed)
280
272
},
281
273
handleFixedHeaderHidden (autoHidden ) {
282
- this .baseConfig .autoHideHeader = autoHidden
283
274
this .$store .dispatch (' ToggleFixedHeaderHidden' , autoHidden)
284
275
},
285
276
handleFixSiderbar (fixed ) {
286
277
if (this .layoutMode === ' topmenu' ) {
287
- this .baseConfig .fixSiderbar = false
288
278
this .$store .dispatch (' ToggleFixSiderbar' , false )
289
279
return
290
280
}
291
- this .baseConfig .fixSiderbar = fixed
292
281
this .$store .dispatch (' ToggleFixSiderbar' , fixed)
293
282
}
294
283
}
0 commit comments