Skip to content

Commit

Permalink
perf: checkbox radio增加按钮样式配置
Browse files Browse the repository at this point in the history
  • Loading branch information
greper committed Aug 18, 2020
1 parent 6baeddc commit 602265b
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 294 deletions.
2 changes: 2 additions & 0 deletions docspress/guide/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ export const crudOptions = {
},
rowHandle: {
//行操作栏,与d2-crud一致,默认配置有修改与删除
width: 100, // 操作列宽度
title: '操作',// 操作列名
view:{//查看按钮
thin: false, //瘦模式,thin=true 且 text=null 可以设置方形按钮节省位置
text: '查看', //按钮文字, null= 取消文字
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,13 @@ export const crudOptions = (vm) => {
}
},
dict: {
data: [{ value: 'sz', label: '深圳' }, { value: 'gz', label: '广州' }, { value: 'wh', label: '武汉' }, { value: 'sh', label: '上海' }]
data: [
{ value: 'sz', label: '深圳' },
{ value: 'gz', label: '广州' },
{ value: 'wh', label: '武汉' },
{ value: 'sh', label: '上海' },
{ value: 'hz', label: '杭州' },
{ value: 'bj', label: '北京' }]
},
component: { props: { color: 'auto' } } // 自动染色
},
Expand Down Expand Up @@ -336,6 +342,33 @@ export const crudOptions = (vm) => {
console.log('您选中了:', value)
}
}
},
{
title: '单选按钮',
key: 'radio_btn',
search: { disabled: true },
type: 'radio',
dict: {
url: '/dicts/OpenStatusEnum'
},
disabled: true,
form: {
component: { props: { type: 'el-radio-button' } }
}
},
{
title: '多选按钮',
key: 'checkbox_btn',
sortable: true,
search: { disabled: true },
type: 'checkbox',
dict: {
url: '/dicts/OpenStatusEnum'
},
disabled: true,
form: {
component: { props: { type: 'el-checkbox-button' } }
}
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const options = {
const list = [
{
status: '0',
mselect: 'sz',
mselect: 'sz,bj,gz,sh,hz,wh',
cascader: ['zhinan', 'shejiyuanze', 'yizhi'],
checkbox: '0',
status_custom_1: '0',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<template>
<el-checkbox-group class="d2p-dict-checkbox" :value="currentValue" :disabled="disabled" :readonly="readonly" v-bind="_elProps" style="width:100%" @input="onInput">
<el-checkbox :disabled="disabled" :readonly="readonly" v-for="option in _options"
<component :is="type" :disabled="disabled" :readonly="readonly" v-for="option in _options"
:key="option[dict.value]"
:label="option[dict.value]"
v-bind="option"
>{{option[dict.label]}}</el-checkbox>
>{{option[dict.label]}}</component>
</el-checkbox-group>
</template>

Expand Down Expand Up @@ -41,6 +41,11 @@ export default {
type: Array,
require: false
},
// 按钮类型 [el-checkbox,el-checkbox-button]
type: {
type: String,
default: 'el-checkbox'
},
onReady: {
type: Function,
require: false
Expand Down
Loading

0 comments on commit 602265b

Please sign in to comment.