mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-12-27 07:34:12 +08:00
fix(button): btn disable
This commit is contained in:
parent
654a07fa9d
commit
59a7273665
@ -11,12 +11,20 @@ export const Button: ParentComponent<
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
class={twMerge(
|
class={twMerge('btn', local.loading ? 'btn-disabled' : local.class)}
|
||||||
'btn',
|
|
||||||
local.disabled && 'btn-disabled',
|
|
||||||
local.loading ? 'btn-disabled' : local.class,
|
|
||||||
)}
|
|
||||||
{...others}
|
{...others}
|
||||||
|
onClick={(e) => {
|
||||||
|
if (props.disabled) {
|
||||||
|
e.preventDefault()
|
||||||
|
e.stopPropagation()
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof props.onClick === 'function') {
|
||||||
|
props.onClick(e)
|
||||||
|
}
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<Show when={local.loading}>
|
<Show when={local.loading}>
|
||||||
<span class="loading loading-spinner" />
|
<span class="loading loading-spinner" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user