Skip to content

Commit

Permalink
feat: radio 支持 button样式
Browse files Browse the repository at this point in the history
  • Loading branch information
greper committed Jul 2, 2021
1 parent 1f31554 commit 60ee9c6
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions packages/fast-crud/src/components/extends/fs-dict-radio.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<template>
<component :is="$fsui.radioGroup.name">
<component
:is="$fsui.radio.name"
:is="computedRadioName"
v-for="item of computedOptions"
:key="getValue(item)"
:[$fsui.radio.value]="getValue(item)"
v-bind="item"
>
{{ getLabel(item) }}
</component>
Expand All @@ -13,7 +14,7 @@
<script>
import { useDict } from "../../use/use-dict";
import { uiContext } from "../../ui";
import { ref, computed } from "vue";
/**
* 字典单选框
* 支持el-radio-group|a-radio-group的参数
Expand All @@ -29,12 +30,23 @@ export default {
/**
* 可选项,比dict.data优先级高
*/
options: { type: Array }
options: { type: Array },
/**
* radio组件名称
* antdv使用button样式的时候有用
*/
radioName: {}
},
setup(props, ctx) {
const ui = uiContext.get();
const computedRadioName = computed(() => {
return props.radioName ?? ui.radio.name;
});
return {
computedRadioName,
...useDict(props, ctx, ui.radioGroup.modelValue)
};
}
Expand Down

0 comments on commit 60ee9c6

Please sign in to comment.