2018-09-10 15:30:32 +08:00
|
|
|
<template>
|
|
|
|
|
<el-dropdown placement="bottom" size="small" @command="handleChange">
|
2019-01-24 18:21:13 +08:00
|
|
|
<el-button class="d2-mr btn-text can-hover" type="text">
|
|
|
|
|
<d2-icon name="font" style="font-size: 16px;"/>
|
|
|
|
|
</el-button>
|
2018-09-10 15:30:32 +08:00
|
|
|
<el-dropdown-menu slot="dropdown">
|
2019-01-24 17:34:46 +08:00
|
|
|
<el-dropdown-item v-for="item in options" :key="item.value" :command="item.value">
|
|
|
|
|
<d2-icon :name="iconName(item.value)" class="d2-mr-5"/>{{item.label}}
|
2018-09-10 15:30:32 +08:00
|
|
|
</el-dropdown-item>
|
|
|
|
|
</el-dropdown-menu>
|
|
|
|
|
</el-dropdown>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2018-09-17 16:17:34 +08:00
|
|
|
import { mapState, mapMutations, mapActions } from 'vuex'
|
2018-09-10 15:30:32 +08:00
|
|
|
export default {
|
2018-09-10 16:13:45 +08:00
|
|
|
name: 'd2-header-size',
|
2018-09-10 15:30:32 +08:00
|
|
|
computed: {
|
|
|
|
|
...mapState('d2admin/size', [
|
|
|
|
|
'value'
|
2019-05-24 10:09:05 +08:00
|
|
|
]),
|
|
|
|
|
options () {
|
|
|
|
|
return [
|
|
|
|
|
{ label: this.$t('layout.header-aside.header-size.options.default'), value: 'default' },
|
|
|
|
|
{ label: this.$t('layout.header-aside.header-size.options.medium'), value: 'medium' },
|
|
|
|
|
{ label: this.$t('layout.header-aside.header-size.options.small'), value: 'small' },
|
|
|
|
|
{ label: this.$t('layout.header-aside.header-size.options.mini'), value: 'mini' }
|
|
|
|
|
]
|
|
|
|
|
}
|
2018-09-10 15:30:32 +08:00
|
|
|
},
|
|
|
|
|
methods: {
|
2018-09-17 16:17:34 +08:00
|
|
|
...mapMutations({
|
|
|
|
|
pageKeepAliveClean: 'd2admin/page/keepAliveClean'
|
|
|
|
|
}),
|
2018-09-14 15:09:58 +08:00
|
|
|
...mapActions({
|
|
|
|
|
sizeSet: 'd2admin/size/set'
|
|
|
|
|
}),
|
2018-09-10 15:30:32 +08:00
|
|
|
handleChange (value) {
|
2018-09-14 15:09:58 +08:00
|
|
|
this.sizeSet(value)
|
2019-05-21 19:37:48 +08:00
|
|
|
this.$notify({
|
2019-05-24 10:09:05 +08:00
|
|
|
title: this.$t('public.notify.special.component-size.changed.title'),
|
2019-05-21 19:37:48 +08:00
|
|
|
dangerouslyUseHTMLString: true,
|
2019-05-24 10:09:05 +08:00
|
|
|
message: this.$t('public.notify.special.component-size.changed.message'),
|
2019-05-21 19:37:48 +08:00
|
|
|
type: 'success'
|
|
|
|
|
})
|
2018-09-10 15:30:32 +08:00
|
|
|
},
|
|
|
|
|
iconName (name) {
|
|
|
|
|
return name === this.value ? 'dot-circle-o' : 'circle-o'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|