build image and file path compatibility repair

Former-commit-id: 69e5e4092b151379d27aa2eccde1255672277fb8 [formerly 69e5e4092b151379d27aa2eccde1255672277fb8 [formerly 69e5e4092b151379d27aa2eccde1255672277fb8 [formerly 69e5e4092b151379d27aa2eccde1255672277fb8 [formerly b70254441d8a42159229d3a1ffb6337a4904ce87 [formerly 218fe905d457ba3c6d7f48ceda77fbd38a6341ce]]]]]
Former-commit-id: 185cbeff13a282fadbf959c1227927501f39a728
Former-commit-id: 5740a528b4627568a348f2d3b59528a16c7a6f34
Former-commit-id: 771cc66a523221c6ee2b0279a0819caab64b2f53 [formerly c7def5344c50d8edf8a3b41a2dbc1305445282f2]
Former-commit-id: 3a9c6a8dd6b4399b04be05749d21692bff9ddc33
Former-commit-id: 6a4677e1001a6ec39cd7e5e051eaee1b1bf85ae1
Former-commit-id: 553208b3aaf49b39a63f495eec7097f9efcb2bd5
Former-commit-id: 1887cc7586fb947dd9f8815e61e6abd349bbdb4b
Former-commit-id: 0ba5ab3302ce4540b3706a32178e515ba9053536
This commit is contained in:
liyang
2018-06-22 01:15:28 +08:00
parent 2ae9ee72f2
commit 9b1fe4cae8
17 changed files with 400 additions and 32 deletions

View File

@@ -6,25 +6,28 @@ export default {
{
name: 'd2admin 经典',
value: 'd2',
preview: '/static/image/theme/d2/preview@2x.png'
preview: 'static/image/theme/d2/preview@2x.png'
},
{
name: '简约线条',
value: 'line',
preview: '/static/image/theme/line/preview@2x.png'
backgroundImage: 'static/image/bg/line-squashed.jpg',
preview: 'static/image/theme/line/preview@2x.png'
},
{
name: '流星',
value: 'star',
preview: '/static/image/theme/star/preview@2x.png'
backgroundImage: 'static/image/bg/star-squashed.jpg',
preview: 'static/image/theme/star/preview@2x.png'
},
{
name: 'Tomorrow Night Blue (vsCode)',
value: 'tomorrow-night-blue',
preview: '/static/image/theme/tomorrow-night-blue/preview@2x.png'
preview: 'static/image/theme/tomorrow-night-blue/preview@2x.png'
}
],
name: ''
name: '',
backGroundImage: ''
},
mutations: {
// 从 cookie 加载主题
@@ -53,6 +56,11 @@ export default {
},
// 激活当前主题
activeTheme (state) {
// 设置背景图片
const themeSetting = state.list.find(e => e.value === state.name)
if (themeSetting) {
state.backGroundImage = themeSetting.backgroundImage || ''
}
document.body.className = `theme-${state.name}`
}
}