no message

Former-commit-id: a4766e75abf319ce89b9a0f4a3ceb97bc1bd7227 [formerly a4766e75abf319ce89b9a0f4a3ceb97bc1bd7227 [formerly a4766e75abf319ce89b9a0f4a3ceb97bc1bd7227 [formerly a4766e75abf319ce89b9a0f4a3ceb97bc1bd7227 [formerly 2615751c4f188770651bfea90bb1f078a6810fb7 [formerly 74c50920b94a6ca5fc7c06c92e7cc1188ea20102]]]]]
Former-commit-id: ee4f713add089a654893db4d7c0606e06ea56aa0
Former-commit-id: 2fcdefc68f10e92895a68e507fb7a23e6d52ec54
Former-commit-id: 69ab4b81c86b55ddf75744ab9d68b9b35b835b3d [formerly afcd944ebc30a0c312617b5f4d39df522f384475]
Former-commit-id: 4c2bc76f3f79ad0a656562d935e9ec4e1e57b215
Former-commit-id: bdd3dd8cc8e9fef3905abf0902852a1d9f83c7ea
Former-commit-id: f8c245182f90a438e4be31259a9041e3b04216a4
Former-commit-id: 397d87f0994ab8aa3db374b068c8996cd0e4f332
Former-commit-id: 45291cf1fb05e8861793ab09c66fdfa1857cdb2a
This commit is contained in:
liyang
2018-07-01 16:32:39 +08:00
parent ef4992ae52
commit bb93372a32
2 changed files with 11 additions and 13 deletions

View File

@@ -10,7 +10,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="address" align="center"> <el-table-column prop="address" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="themeActiveSetting.name === scope.row.name" type="success" icon="el-icon-check" round>已激活</el-button> <el-button v-if="themeActiveName === scope.row.name" type="success" icon="el-icon-check" round>已激活</el-button>
<el-button v-else round @click="handleSelectTheme(scope.row.name)">使用</el-button> <el-button v-else round @click="handleSelectTheme(scope.row.name)">使用</el-button>
</template> </template>
</el-table-column> </el-table-column>
@@ -18,7 +18,7 @@
</template> </template>
<script> <script>
import { mapState, mapGetters, mapMutations } from 'vuex' import { mapState, mapMutations } from 'vuex'
export default { export default {
name: 'd2-theme-list', name: 'd2-theme-list',
data () { data () {
@@ -31,11 +31,9 @@ export default {
}, },
computed: { computed: {
...mapState({ ...mapState({
themeList: state => state.d2admin.themeList themeList: state => state.d2admin.themeList,
}), themeActiveName: state => state.d2admin.themeActiveName
...mapGetters([ })
'themeActiveSetting'
])
}, },
methods: { methods: {
...mapMutations([ ...mapMutations([

View File

@@ -12,8 +12,8 @@
</el-table-column> </el-table-column>
<el-table-column prop="address" align="center"> <el-table-column prop="address" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="themeActive.value === scope.row.value" type="success" icon="el-icon-check" round>已激活</el-button> <el-button v-if="themeActiveName === scope.row.name" type="success" icon="el-icon-check" round>已激活</el-button>
<el-button v-else round @click="handleSelectTheme(scope.row.value)">使用</el-button> <el-button v-else round @click="handleSelectTheme(scope.row.name)">使用</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -25,7 +25,7 @@
</el-button> </el-button>
</div> </div>
<template slot="footer"> <template slot="footer">
<el-button type="primary" size="small">当前激活主题 {{themeActive.name}}</el-button> <el-button type="primary" size="small">当前激活主题 {{themeActiveName}}</el-button>
</template> </template>
</d2-container> </d2-container>
</template> </template>
@@ -44,15 +44,15 @@ export default {
computed: { computed: {
...mapState({ ...mapState({
themeList: state => state.d2admin.themeList, themeList: state => state.d2admin.themeList,
themeActive: state => state.d2admin.themeActive themeActiveName: state => state.d2admin.themeActiveName
}) })
}, },
methods: { methods: {
...mapMutations([ ...mapMutations([
'd2adminThemeSet' 'd2adminThemeSet'
]), ]),
handleSelectTheme (value) { handleSelectTheme (name) {
this.d2adminThemeSet(value) this.d2adminThemeSet(name)
} }
} }
} }