Skip to content

Commit

Permalink
fix: 修复naive button 图标错乱问题
Browse files Browse the repository at this point in the history
  • Loading branch information
greper committed Mar 23, 2022
1 parent 347694f commit be28c9c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/fast-crud/src/components/basic/fs-button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ export default defineComponent({
const isIconSlot = ui.type !== "element";
const slots = {
...this.$slots,
default: () => {
};
if(
icon && !isIconSlot
|| this.$slots.default
|| this.text
|| iconRight
){
slots.default = () => {
const children: any = [];
if (icon && !isIconSlot) {
children.push(iconRender());
Expand All @@ -55,7 +62,7 @@ export default defineComponent({
}
return children;
}
};
}
if (icon && isIconSlot && !slots["icon"]) {
slots["icon"] = iconRender;
}
Expand Down

0 comments on commit be28c9c

Please sign in to comment.