mirror of
https://github.com/smartxworks/sunmao-ui.git
synced 2025-02-11 17:37:40 +08:00
feat(link): add default status
This commit is contained in:
parent
6c8b1b678d
commit
40e5af4f06
@ -11,12 +11,20 @@ const LinkStateSpec = Type.Object({});
|
||||
const exampleProperties: Static<typeof LinkPropsSpec> = {
|
||||
disabled: false,
|
||||
hoverable: true,
|
||||
status: 'warning',
|
||||
status: 'default',
|
||||
href: 'https://www.smartx.com/',
|
||||
content: 'Link',
|
||||
};
|
||||
|
||||
const options = {
|
||||
|
||||
const statusMap = {
|
||||
default: undefined,
|
||||
success: 'success',
|
||||
error: 'error',
|
||||
warning: 'warning',
|
||||
} as const;
|
||||
|
||||
export const Link = implementRuntimeComponent({
|
||||
version: 'arco/v1',
|
||||
metadata: {
|
||||
...FALLBACK_METADATA,
|
||||
@ -35,16 +43,14 @@ const options = {
|
||||
styleSlots: ['content'],
|
||||
events: [],
|
||||
},
|
||||
};
|
||||
|
||||
export const Link = implementRuntimeComponent(options)(props => {
|
||||
})(props => {
|
||||
const { content, status, ...cProps } = getComponentProps(props);
|
||||
const { elementRef, customStyle } = props;
|
||||
|
||||
return (
|
||||
<BaseLink
|
||||
ref={elementRef}
|
||||
status={status}
|
||||
status={statusMap[status]}
|
||||
className={css(customStyle?.content)}
|
||||
{...cProps}
|
||||
>
|
||||
|
@ -18,7 +18,7 @@ export const LinkPropsSpec = {
|
||||
category: Category.Style,
|
||||
description: 'Whether to hide background when hover'
|
||||
}),
|
||||
status: StringUnion(['success', 'warning', 'error'], {
|
||||
status: StringUnion(['default','success', 'warning', 'error'], {
|
||||
title: 'Status',
|
||||
category: Category.Style,
|
||||
}),
|
||||
|
Loading…
Reference in New Issue
Block a user