Skip to content

Commit

Permalink
fix: 日期示例、checkbox radio 支持按钮样式、边框样式
Browse files Browse the repository at this point in the history
  • Loading branch information
greper committed Oct 31, 2021
1 parent 98b5628 commit b2905eb
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/fast-admin/fs-admin-element
Submodule fs-admin-element updated from e34ca6 to c7c068
22 changes: 20 additions & 2 deletions packages/fast-crud/src/components/extends/fs-dict-checkbox.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<template>
<component :is="$fsui.checkboxGroup.name">
<component
:is="$fsui.checkbox.name"
:is="optionName || $fsui.checkbox.name"
v-for="item of computedOptions"
:key="getValue(item)"
:[$fsui.checkbox.value]="getValue(item)"
v-bind="optionProps"
>{{ getLabel(item) }}</component
>
</component>
Expand All @@ -27,7 +28,24 @@ export default {
/**
* 选项,比dict.data优先级高
*/
options: { type: Array, default: undefined, require: false }
options: { type: Array, default: undefined, require: false },
/**
* 选项的组件名称
*/
optionName: {
type: String
},
/**
* 选项的属性
*/
optionProps: {
type: Object,
default() {
return {};
}
}
},
setup(props, ctx) {
const ui = uiContext.get();
Expand Down
26 changes: 24 additions & 2 deletions packages/fast-crud/src/components/extends/fs-dict-radio.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
v-for="item of computedOptions"
:key="getValue(item)"
:[$fsui.radio.value]="getValue(item)"
v-bind="optionProps"
>
{{ getLabel(item) }}
</component>
Expand Down Expand Up @@ -34,14 +35,35 @@ export default {
/**
* radio组件名称
* antdv使用button样式的时候有用
* 即将废弃,请使用optionName
*/
radioName: {}
radioName: {},
/**
* 选项的组件名称
*/
optionName: {
type: String
},
/**
* 选项的属性
*/
optionProps: {
type: Object,
default() {
return {};
}
}
},
setup(props, ctx) {
const ui = uiContext.get();
if (props.radioName) {
console.warn("参数radioName即将废弃,请改成optionName");
}
const computedRadioName = computed(() => {
return props.radioName ?? ui.radio.name;
return props.optionName ?? props.radioName ?? ui.radio.name;
});
return {
Expand Down

0 comments on commit b2905eb

Please sign in to comment.