Skip to content

Commit

Permalink
fix: button ignore props loading
Browse files Browse the repository at this point in the history
  • Loading branch information
daief committed Feb 9, 2023
1 parent 851734b commit 8fa7e1b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/button/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
import { ctxKey, ICtx } from './state';
import { componentV2 } from 'daisyui-vue/shared/styled';
import style from './style';
import { isUndefined } from 'daisyui-vue/shared/utils';

export type IButtonShape = 'defalut' | 'circle' | 'square';

Expand Down Expand Up @@ -68,7 +69,9 @@ export const Button = componentV2<

const clickLoading = ref(false);

const finalLoading = computed(() => props.loading || clickLoading.value);
const finalLoading = computed(() =>
isUndefined(props.loading) ? clickLoading.value : props.loading,
);

const cls = computed(() => {
return [
Expand Down

0 comments on commit 8fa7e1b

Please sign in to comment.