Skip to content

Commit

Permalink
docs: 优化组件示例
Browse files Browse the repository at this point in the history
  • Loading branch information
zyprepare committed Sep 26, 2024
1 parent e8e4c44 commit 783e435
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
1 change: 1 addition & 0 deletions packages/ui/date-picker/stories/range.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const Range = () => {
/>

<h2></h2>
{/* 如果遇到周范围选择选值问题,尝试手动引入 import 'moment/locale/zh-cn' */}
<DatePicker
style={{ width: 480 }}
type="weekrange"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const YearMonthWeek = () => {
/>

<h2></h2>
{/* 如果遇到周选择选值问题,尝试手动引入 import 'moment/locale/zh-cn' */}
<DatePicker
style={{ width: 238 }}
type="week"
Expand Down
35 changes: 22 additions & 13 deletions packages/ui/notification/stories/custom.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import { createNotification } from '../src'
import Button from '@hi-ui/button'

/**
* @title notification 属性自定义
* @title notification 属性配置
* @desc 支持配置 container 和 zIndex
*/
export const Custom = () => {
const [container, setContainer] = useState<HTMLElement | undefined>()
const [container, setContainer] = useState<HTMLElement>()

const notification = useMemo(
() =>
Expand All @@ -20,33 +21,41 @@ export const Custom = () => {
return (
<>
<h1>Custom</h1>

<div
ref={(e) => {
setContainer(e)
e && setContainer(e)
}}
id="ddd"
className="notification-custom__wrap"
style={{
width: 400,
height: 300,
background: 'rgb(245, 247, 250)',
width: '100%',
minWidth: 660,
height: 420,
marginBottom: 20,
background: '#f5f7fa',
boxShadow: '1px 2px 8px #ddd',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',

// Need add it
// Need add for it
position: 'relative',
overflow: 'hidden',
zIndex: 0,
}}
></div>

<div className="notification-custom__wrap">
>
<Button
type="primary"
onClick={() => {
notification.open({
size: 'sm',
title: '数据备份通知',
content:
'各位同学请注意,将于2019.08.10 00:00:00 -08:00:00 期间进行系统服务器升级维护,请做好数据备份工作,以防丢失。带来不便,敬请谅解!',
'各位同学请注意,将于2019.08.10 00:00:00 -08:00:00 期间进行系统服务器升级维护!',
})
}}
>
Notice
Open
</Button>
</div>
</>
Expand Down

0 comments on commit 783e435

Please sign in to comment.