no message

Former-commit-id: d034f2b55040b82f43f4b3149cad9cfd235e407c
Former-commit-id: a38ce483556a25b80fef13acf080f97e8b2d6540
Former-commit-id: d8ffe7f8f5925f50b59c3bcd5e35c5a3e10271af
This commit is contained in:
liyang
2018-06-11 13:53:48 +08:00
parent 1d67560596
commit fa0a1ac5cb
2 changed files with 19 additions and 18 deletions

View File

@@ -1,5 +1,5 @@
<template>
<el-table v-bind="table">
<el-table :data="themeList" v-bind="table">
<el-table-column prop="name" align="center" width="160"/>
<el-table-column label="预览" width="220">
<div slot-scope="scope" class="theme-preview" :style="{'backgroundImage': `url(${ scope.row.preview })`}"></div>
@@ -19,18 +19,6 @@ export default {
data () {
return {
table: {
data: [
{
name: 'd2admin 经典',
value: 'd2',
preview: '/static/image/theme-preview/d2@2x.png'
},
{
name: '流星',
value: 'star',
preview: '/static/image/theme-preview/star@2x.png'
}
],
showHeader: false,
border: true
}
@@ -41,7 +29,8 @@ export default {
},
computed: {
...mapState({
themeName: state => state.theme.themeName
themeList: state => state.theme.list,
themeName: state => state.theme.name
})
},
methods: {

View File

@@ -1,12 +1,24 @@
export default {
state: {
themeName: 'star'
list: [
{
name: 'd2admin 经典',
value: 'd2',
preview: '/static/image/theme-preview/d2@2x.png'
},
{
name: '流星',
value: 'star',
preview: '/static/image/theme-preview/star@2x.png'
}
],
name: 'star'
},
mutations: {
// 设置主题
setTheme (state, themeName) {
state.themeName = themeName
document.body.className = `theme-${state.themeName}`
setTheme (state, name) {
state.name = name
document.body.className = `theme-${state.name}`
}
}
}