Skip to content

Commit

Permalink
docs(overlay): 文档优化 (#1706)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyatong authored Nov 30, 2023
1 parent e9f8ed4 commit ce18097
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
26 changes: 14 additions & 12 deletions src/packages/overlay/demo.scss
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
.wrapper {
display: flex;
height: 100%;
align-items: center;
justify-content: center;

.content {
.nut-overlay {
.wrapper {
display: flex;
width: 150px;
height: 150px;
background: #fff;
border-radius: 8px;
height: 100%;
align-items: center;
justify-content: center;
color: red;

.content {
display: flex;
width: 150px;
height: 150px;
background: #fff;
border-radius: 8px;
align-items: center;
justify-content: center;
color: red;
}
}
}
8 changes: 4 additions & 4 deletions src/packages/overlay/demo.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const OverlayDemo = () => {
'2a9e4928': '显示遮罩层',
duration: '设置动画时间',
lockscroll: '不锁定背景滚动',
abbf9359: '遮罩样式',
abbf9359: '自定义遮罩样式',
ec0d7acf: '嵌套内容',
ce1e18a2: '这里是正文',
closeClickLay: '点击遮罩不关闭',
Expand All @@ -32,7 +32,7 @@ const OverlayDemo = () => {
'2a9e4928': '顯示遮罩層',
duration: '設置動畫時間',
lockscroll: '不鎖定背景滾動',
abbf9359: '遮罩樣式',
abbf9359: '自定義遮罩樣式',
ec0d7acf: '嵌套內容',
ce1e18a2: '這裡是正文',
closeClickLay: '點擊遮罩不關閉',
Expand All @@ -42,7 +42,7 @@ const OverlayDemo = () => {
'2a9e4928': 'Show mask layer',
duration: 'Set animation time',
lockscroll: 'Donot Lock background scrolling',
abbf9359: 'Mask style',
abbf9359: 'Custom mask style',
ec0d7acf: 'nested content',
ce1e18a2: 'here is the text',
closeClickLay: 'Click the mask not to close',
Expand Down Expand Up @@ -124,7 +124,7 @@ const OverlayDemo = () => {
visible={visible2}
onClick={onClose2}
style={{
backgroundColor: 'rgba(0, 0, 0, .2)',
backgroundColor: 'rgba(0, 0, 0, .4)',
'--nutui-overlay-zIndex': 2000,
}}
/>
Expand Down
8 changes: 4 additions & 4 deletions src/packages/overlay/demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const OverlayDemo = () => {
'2a9e4928': '显示遮罩层',
duration: '设置动画时间',
lockscroll: '不锁定背景滚动',
abbf9359: '遮罩样式',
abbf9359: '自定义遮罩样式',
ec0d7acf: '嵌套内容',
ce1e18a2: '这里是正文',
closeClickLay: '点击遮罩不关闭',
Expand All @@ -33,7 +33,7 @@ const OverlayDemo = () => {
'2a9e4928': '顯示遮罩層',
duration: '設置動畫時間',
lockscroll: '不鎖定背景滾動',
abbf9359: '遮罩樣式',
abbf9359: '自定義遮罩樣式',
ec0d7acf: '嵌套內容',
ce1e18a2: '這裡是正文',
closeClickLay: '點擊遮罩不關閉',
Expand All @@ -43,7 +43,7 @@ const OverlayDemo = () => {
'2a9e4928': 'Show mask layer',
duration: 'Set animation time',
lockscroll: 'Donot Lock background scrolling',
abbf9359: 'Mask style',
abbf9359: 'Custom mask style',
ec0d7acf: 'nested content',
ce1e18a2: 'here is the text',
closeClickLay: 'Click the mask not to close',
Expand Down Expand Up @@ -124,7 +124,7 @@ const OverlayDemo = () => {
visible={visible2}
onClick={onClose2}
style={{
backgroundColor: 'rgba(0, 0, 0, .2)',
backgroundColor: 'rgba(0, 0, 0, .4)',
'--nutui-overlay-zIndex': 2000,
}}
/>
Expand Down
3 changes: 1 addition & 2 deletions src/packages/overlay/overlay.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,10 @@ export const Overlay: FunctionComponent<
...defaultOverlayProps,
...props,
}
const classPrefix = `nut-overlay`

const [innerVisible, setInnerVisible] = useState(visible)

const classPrefix = `nut-overlay`

const nodeRef = useLockScrollTaro(!!props.lockScroll && innerVisible)

useEffect(() => {
Expand Down
3 changes: 1 addition & 2 deletions src/packages/overlay/overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,10 @@ export const Overlay: FunctionComponent<
...defaultOverlayProps,
...props,
}
const classPrefix = `nut-overlay`

const [innerVisible, setInnerVisible] = useState(visible)

const classPrefix = `nut-overlay`

const nodeRef = useRef(null)

useEffect(() => {
Expand Down

0 comments on commit ce18097

Please sign in to comment.