Merge branch 'develop' of https://github.com/d2-projects/d2-admin into develop
Former-commit-id: a6222c08e96071517bacac6181742066674b06cc [formerly a6222c08e96071517bacac6181742066674b06cc [formerly a6222c08e96071517bacac6181742066674b06cc [formerly a6222c08e96071517bacac6181742066674b06cc [formerly 68ebd02f1c01d7717654ada55f88891f9df7e4f9 [formerly d8a32cc7960c8c3726d79ef011642cccd09d3433]]]]] Former-commit-id: 42f6e76d0fe53d0e15155965b323e1b28e78f659 Former-commit-id: 5c15c1d97f9ee8ae949ec9cfad618156c92b0d68 Former-commit-id: f810c8822877fc66308814fff43b76d6b0d2d07e [formerly 5cb0c6e5c8a56c98057afe1645149dec84165cd4] Former-commit-id: 3c8ab71382cfbe0ff5796c4e15a55fd55490908b Former-commit-id: 8407af6c2382c329f79f8e6a86fe1f759168f9a0 Former-commit-id: 99118e525d99e56154a60a559ae1b7e137d6287f Former-commit-id: 1d550de719aa368d64516c75d224aaab04529de8 Former-commit-id: 2825ae752fc29e37c51e7f25969d49ecd3c2ab3c
This commit is contained in:
@@ -2,8 +2,9 @@
|
||||
<el-color-picker
|
||||
class="btn-text can-hover"
|
||||
:value="value"
|
||||
:predefine="predefine"
|
||||
size="mini"
|
||||
@change="colorSet"/>
|
||||
@change="set"/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -11,6 +12,19 @@ import { mapState, mapActions } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'd2-header-color',
|
||||
data () {
|
||||
return {
|
||||
predefine: [
|
||||
'#ff4500',
|
||||
'#ff8c00',
|
||||
'#ffd700',
|
||||
'#90ee90',
|
||||
'#00ced1',
|
||||
'#1e90ff',
|
||||
'#c71585'
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState('d2admin/color', [
|
||||
'value'
|
||||
@@ -18,13 +32,13 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
value (value) {
|
||||
this.colorSet(value)
|
||||
this.set(value)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapActions({
|
||||
colorSet: 'd2admin/color/set'
|
||||
})
|
||||
...mapActions('d2admin/color', [
|
||||
'set'
|
||||
])
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -18,7 +18,7 @@ export default {
|
||||
// 记录上个值
|
||||
const old = state.value
|
||||
// store 赋值
|
||||
state.value = color
|
||||
state.value = color || process.env.VUE_APP_ELEMENT_COLOR
|
||||
// 持久化
|
||||
await dispatch('d2admin/db/set', {
|
||||
dbName: 'sys',
|
||||
|
||||
@@ -40,7 +40,7 @@ module.exports = {
|
||||
matchColors: [
|
||||
...forElementUI.getElementUISeries(process.env.VUE_APP_ELEMENT_COLOR) // Element-ui主色系列
|
||||
],
|
||||
externalCssFiles: ['./node_modules/element-ui/lib/theme-chalk/index.css'], // optional, String or string array. Set external css files (such as cdn css) to extract colors.
|
||||
externalCssFiles: [ './node_modules/element-ui/lib/theme-chalk/index.css' ], // optional, String or string array. Set external css files (such as cdn css) to extract colors.
|
||||
changeSelector: forElementUI.changeSelector
|
||||
})
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user