perf[SizeSelect]: add default size option (#1566)

This commit is contained in:
花裤衩 2019-01-30 12:58:30 +08:00 committed by GitHub
parent b44000c9de
commit 4b3a41c535
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 3 deletions

View File

@ -4,15 +4,24 @@
<svg-icon class-name="size-icon" icon-class="size" />
</div>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :disabled="size==='medium'" command="medium">Medium</el-dropdown-item>
<el-dropdown-item :disabled="size==='small'" command="small">Small</el-dropdown-item>
<el-dropdown-item :disabled="size==='mini'" command="mini">Mini</el-dropdown-item>
<el-dropdown-item v-for="item of sizeOptions" :key="item.value" :disabled="size===item.value" :command="item.value">{{
item.label }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
<script>
export default {
data() {
return {
sizeOptions: [
{ label: 'Default', value: 'default' },
{ label: 'Medium', value: 'medium' },
{ label: 'Small', value: 'small' },
{ label: 'Mini', value: 'mini' }
]
}
},
computed: {
size() {
return this.$store.getters.size