Files
mes-ui-d2/src/layout/header-aside/components/header-size/index.vue
FairyEver bf2abb9a7a fix https://github.com/d2-projects/d2-admin/issues/198
Former-commit-id: a90637e57de8a016135aeb5b4d43d1db78eed7b1 [formerly df1374a5bf87d104dc2f41a1f6eeb6ba075c2923] [formerly a90637e57de8a016135aeb5b4d43d1db78eed7b1 [formerly df1374a5bf87d104dc2f41a1f6eeb6ba075c2923] [formerly a90637e57de8a016135aeb5b4d43d1db78eed7b1 [formerly df1374a5bf87d104dc2f41a1f6eeb6ba075c2923] [formerly df1374a5bf87d104dc2f41a1f6eeb6ba075c2923 [formerly 6b854444d7f338481165fc1c4c999f866282958e [formerly 1371e68396bb244a22bc579bb55f12e5b6c40809]]]]]
Former-commit-id: 1815aa974e40b1de51ad22359615b8d169793ba1
Former-commit-id: 30a07d937aca2e3156551b823c72dea29188314e
Former-commit-id: 4180971ccf5277ea71eb8864df232fc3faf1f4d3 [formerly 8b4d133ffebc9382606ef6bd19c35415a8a88422]
Former-commit-id: 0399bc6935c57909850285c807624a04ed919690
Former-commit-id: c5a7c8f7e5c4b8945a096e8b2a9b362817e3e49b
Former-commit-id: 6195d04a71287b56282310563694e59578ef7f3b
Former-commit-id: 9b75da52937cce80ef16fc6e1ab20777723be3f8
Former-commit-id: 6ec6d677cc099762d68ef23332a5845085aa0c57
2019-07-16 20:43:50 +08:00

53 lines
1.6 KiB
Vue

<template>
<el-dropdown placement="bottom" size="small" @command="handleChange">
<el-button class="d2-mr btn-text can-hover" type="text">
<d2-icon name="font" style="font-size: 16px;"/>
</el-button>
<el-dropdown-menu slot="dropdown">
<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}}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
<script>
import { mapState, mapMutations, mapActions } from 'vuex'
export default {
name: 'd2-header-size',
computed: {
...mapState('d2admin/size', [
'value'
]),
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' }
]
}
},
methods: {
...mapMutations({
pageKeepAliveClean: 'd2admin/page/keepAliveClean'
}),
...mapActions({
sizeSet: 'd2admin/size/set'
}),
handleChange (value) {
this.sizeSet(value)
this.$notify({
title: this.$t('public.notify.special.component-size.changed.title'),
dangerouslyUseHTMLString: true,
message: this.$t('public.notify.special.component-size.changed.message'),
type: 'success'
})
},
iconName (name) {
return name === this.value ? 'dot-circle-o' : 'circle-o'
}
}
}
</script>