优化
This commit is contained in:
19
client/packages/design/components/DelayTip/index.stories.tsx
Normal file
19
client/packages/design/components/DelayTip/index.stories.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import React from 'react';
|
||||
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
||||
|
||||
import { DelayTip } from '.';
|
||||
|
||||
export default {
|
||||
title: 'Tailchat/DelayTip',
|
||||
component: DelayTip,
|
||||
argTypes: {},
|
||||
} as ComponentMeta<typeof DelayTip>;
|
||||
|
||||
const Template: ComponentStory<typeof DelayTip> = (args) => (
|
||||
<DelayTip {...args}>鼠标移动到这里等待1s</DelayTip>
|
||||
);
|
||||
|
||||
export const Default = Template.bind({});
|
||||
Default.args = {
|
||||
title: 'Hello World',
|
||||
};
|
||||
14
client/packages/design/components/DelayTip/index.tsx
Normal file
14
client/packages/design/components/DelayTip/index.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import { Tooltip, TooltipProps } from 'antd';
|
||||
import React from 'react';
|
||||
|
||||
/**
|
||||
* 延时提示
|
||||
*/
|
||||
export const DelayTip: React.FC<TooltipProps> = React.memo((props) => {
|
||||
return (
|
||||
<Tooltip mouseEnterDelay={1} {...props}>
|
||||
{props.children}
|
||||
</Tooltip>
|
||||
);
|
||||
});
|
||||
DelayTip.displayName = 'DelayTip';
|
||||
Reference in New Issue
Block a user