未验证 提交 16474f18 编写于 作者: C cuicuiworld 提交者: GitHub

feat: tag组件添加自定义className和style属性 (#435)

上级 14b75f46
......@@ -39,6 +39,8 @@ const defaultProps = {
} as TagProps
export const Tag: FunctionComponent<Partial<TagProps>> = (props) => {
const {
className,
style,
color,
plain,
type,
......@@ -106,8 +108,8 @@ export const Tag: FunctionComponent<Partial<TagProps>> = (props) => {
{closeable ? (
isTagShow && (
<div
className={`${btnName}`}
style={getStyle()}
className={`${btnName} ${className}`}
style={{ ...style, ...getStyle() }}
onClick={(e) => handleClick(e)}
>
{children && <span className="text">{children}</span>}
......@@ -128,8 +130,8 @@ export const Tag: FunctionComponent<Partial<TagProps>> = (props) => {
)
) : (
<div
className={`${btnName}`}
style={getStyle()}
className={`${btnName} ${className}`}
style={{ ...style, ...getStyle() }}
onClick={(e) => handleClick(e)}
>
{children && <span className="text">{children}</span>}
......
......@@ -39,6 +39,8 @@ const defaultProps = {
} as TagProps
export const Tag: FunctionComponent<Partial<TagProps>> = (props) => {
const {
className,
style,
color,
plain,
type,
......@@ -106,8 +108,8 @@ export const Tag: FunctionComponent<Partial<TagProps>> = (props) => {
{closeable ? (
isTagShow && (
<div
className={`${btnName}`}
style={getStyle()}
className={`${btnName} ${className}`}
style={{ ...style, ...getStyle() }}
onClick={(e) => handleClick(e)}
>
{children && <span className="text">{children}</span>}
......@@ -128,8 +130,8 @@ export const Tag: FunctionComponent<Partial<TagProps>> = (props) => {
)
) : (
<div
className={`${btnName}`}
style={getStyle()}
className={`${btnName} ${className}`}
style={{ ...style, ...getStyle() }}
onClick={(e) => handleClick(e)}
>
{children && <span className="text">{children}</span>}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册