Chnging platform changes theme
This commit is contained in:
parent
1e9b248f24
commit
eb8633c630
|
@ -25,6 +25,12 @@ module.exports = {
|
||||||
*/
|
*/
|
||||||
sidebarLogo: false,
|
sidebarLogo: false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {string} true | false
|
||||||
|
* @description Decide which countrys platform to show to the user
|
||||||
|
*/
|
||||||
|
platform: 'DE',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {string | array} 'production' | ['production', 'development']
|
* @type {string | array} 'production' | ['production', 'development']
|
||||||
* @description Need show err logs component.
|
* @description Need show err logs component.
|
||||||
|
|
|
@ -8,6 +8,9 @@ $--color-primary: #1890ff;
|
||||||
$--color-success: #13ce66;
|
$--color-success: #13ce66;
|
||||||
$--color-warning: #FFBA00;
|
$--color-warning: #FFBA00;
|
||||||
$--color-danger: #ff4949;
|
$--color-danger: #ff4949;
|
||||||
|
$--color-UKTheme: #29CBDD;
|
||||||
|
$--color-DETheme: #41ED1B;
|
||||||
|
|
||||||
// $--color-info: #1E1E1E;
|
// $--color-info: #1E1E1E;
|
||||||
|
|
||||||
$--button-font-weight: 400;
|
$--button-font-weight: 400;
|
||||||
|
@ -27,5 +30,5 @@ $--font-path: '~element-ui/lib/theme-chalk/fonts';
|
||||||
// the :export directive is the magic sauce for webpack
|
// the :export directive is the magic sauce for webpack
|
||||||
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass
|
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass
|
||||||
:export {
|
:export {
|
||||||
theme: $--color-primary;
|
theme: $--color-DETheme;
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,9 +92,12 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
lineChartData: lineChartData.newVisitis,
|
lineChartData: lineChartData.newVisitis,
|
||||||
platform: 'UK'
|
platform: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
created() {
|
||||||
|
this.platform = this.$store.state.settings.platform
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleSetLineChartData(type) {
|
handleSetLineChartData(type) {
|
||||||
this.lineChartData = lineChartData[type]
|
this.lineChartData = lineChartData[type]
|
||||||
|
@ -104,7 +107,14 @@ export default {
|
||||||
key: 'platform',
|
key: 'platform',
|
||||||
value: this.platform
|
value: this.platform
|
||||||
})
|
})
|
||||||
console.log(this.$store.state.settings.platform)
|
this.themeChange()
|
||||||
|
},
|
||||||
|
themeChange() {
|
||||||
|
const themeColour = this.platform === 'UK' ? '#29CBDD' : '#41ED1B'
|
||||||
|
this.$store.dispatch('settings/changeSetting', {
|
||||||
|
key: 'theme',
|
||||||
|
value: themeColour
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue