diff --git a/src/components/Fab/index.tsx b/src/components/Fab/index.tsx index a764cb36..6c6eb5a8 100644 --- a/src/components/Fab/index.tsx +++ b/src/components/Fab/index.tsx @@ -40,8 +40,6 @@ export interface FabProps { * Fab 按钮 */ export const Fab: Component = (_props) => { - onMount(() => useStyle(style)); - const props = mergeProps( { progress: 0, initialShow: true, autoTrans: false }, _props, @@ -72,6 +70,7 @@ export const Fab: Component = (_props) => { return (
useStyle(style, ref)} class={classes.fabRoot} data-show={props.show ?? show()} data-trans={props.autoTrans} diff --git a/src/components/IconButton/index.tsx b/src/components/IconButton/index.tsx index ddd6de78..7320e750 100644 --- a/src/components/IconButton/index.tsx +++ b/src/components/IconButton/index.tsx @@ -1,4 +1,4 @@ -import { type Component, type JSX, mergeProps, onMount } from 'solid-js'; +import { type Component, type JSX, mergeProps } from 'solid-js'; import { useStyle } from 'helper'; import classes, { css as style } from './index.module.css'; @@ -24,8 +24,6 @@ interface IconButtonProps { /** 图标按钮 */ export const IconButton: Component = (_props) => { - onMount(() => useStyle(style)); - const props = mergeProps({ placement: 'right' }, _props); let buttonRef: HTMLButtonElement; const handleClick: EventHandler['on:click'] = (e) => { @@ -35,7 +33,11 @@ export const IconButton: Component = (_props) => { }; return ( -
+
useStyle(style, ref)} + class={classes.iconButtonItem} + data-show={props.showTip} + >