-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
57b0206
commit 96dc951
Showing
15 changed files
with
242 additions
and
552 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react' | ||
import { BackTop, Cell } from '@nutui/nutui-react' | ||
|
||
const Demo1 = () => { | ||
return ( | ||
<div id="target" style={{ height: '100vh' }}> | ||
{new Array(24).fill(0).map((_, index) => { | ||
return <Cell key={index}>我是测试数据{index}</Cell> | ||
})} | ||
<BackTop target="target" /> | ||
</div> | ||
) | ||
} | ||
export default Demo1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react' | ||
import { BackTop, Cell } from '@nutui/nutui-react' | ||
|
||
const Demo2 = () => { | ||
return ( | ||
<div id="target" style={{ height: '100vh' }}> | ||
{new Array(24).fill(0).map((_, index) => { | ||
return <Cell key={index}>我是测试数据{index}</Cell> | ||
})} | ||
<BackTop target="target" threshold={200} /> | ||
</div> | ||
) | ||
} | ||
export default Demo2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React from 'react' | ||
import { Top } from '@nutui/icons-react' | ||
import { BackTop, Cell } from '@nutui/nutui-react' | ||
|
||
const Demo3 = () => { | ||
return ( | ||
<div id="target" style={{ height: '100vh' }}> | ||
{new Array(24).fill(0).map((_, index) => { | ||
return <Cell key={index}>我是测试数据{index}</Cell> | ||
})} | ||
<BackTop threshold={100}> | ||
<div | ||
style={{ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
alignItems: 'center', | ||
}} | ||
> | ||
<Top width={12} height={12} /> | ||
<div style={{ fontSize: '12px' }}>顶部</div> | ||
</div> | ||
</BackTop> | ||
</div> | ||
) | ||
} | ||
export default Demo3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react' | ||
import { BackTop, Cell } from '@nutui/nutui-react' | ||
|
||
const Demo4 = () => { | ||
return ( | ||
<div id="target" style={{ height: '800px', overflowY: 'auto' }}> | ||
{new Array(24).fill(0).map((_, index) => { | ||
return <Cell key={index}>我是测试数据{index}</Cell> | ||
})} | ||
<BackTop target="target" threshold={100} /> | ||
</div> | ||
) | ||
} | ||
export default Demo4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import React from 'react' | ||
import { BackTop, Cell } from '@nutui/nutui-react' | ||
import { Top } from '@nutui/icons-react' | ||
|
||
const Demo5 = () => { | ||
const handleClick = () => { | ||
console.log('触发返回顶部') | ||
} | ||
return ( | ||
<div style={{ height: '100vh', overflowY: 'auto' }} id="target"> | ||
{new Array(24).fill(0).map((_, index) => { | ||
return <Cell key={index}>我是测试数据{index}</Cell> | ||
})} | ||
<BackTop | ||
threshold={200} | ||
style={{ | ||
bottom: '50px', | ||
right: '20px', | ||
}} | ||
onClick={handleClick} | ||
target="target" | ||
> | ||
<div | ||
style={{ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
alignItems: 'center', | ||
}} | ||
> | ||
<Top width={12} height={12} /> | ||
<div style={{ fontSize: '12px' }}>顶部</div> | ||
</div> | ||
</BackTop> | ||
</div> | ||
) | ||
} | ||
export default Demo5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from 'react' | ||
import { BackTop, Cell } from '@nutui/nutui-react-taro' | ||
import { Top } from '@nutui/icons-react-taro' | ||
|
||
const Demo1 = () => { | ||
return ( | ||
<div> | ||
{new Array(24).fill(0).map((_, index) => { | ||
return <Cell key={index}>我是测试数据{index}</Cell> | ||
})} | ||
<BackTop | ||
threshold={200} | ||
style={{ | ||
bottom: '50px', | ||
insetInlineEnd: '20px', | ||
}} | ||
> | ||
<div | ||
style={{ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
alignItems: 'center', | ||
}} | ||
> | ||
<Top size={12} /> | ||
<div style={{ fontSize: '12px' }}>顶部</div> | ||
</div> | ||
</BackTop> | ||
</div> | ||
) | ||
} | ||
export default Demo1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react' | ||
import { BackTop, Cell } from '@nutui/nutui-react-taro' | ||
|
||
const Demo2 = () => { | ||
return ( | ||
<div style={{ height: '100vh' }}> | ||
{new Array(24).fill(0).map((_, index) => { | ||
return <Cell key={index}>我是测试数据{index}</Cell> | ||
})} | ||
<BackTop threshold={200} /> | ||
</div> | ||
) | ||
} | ||
export default Demo2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React from 'react' | ||
import { Top } from '@nutui/icons-react-taro' | ||
import { BackTop, Cell } from '@nutui/nutui-react-taro' | ||
|
||
const Demo3 = () => { | ||
return ( | ||
<div style={{ height: '100vh' }}> | ||
{new Array(24).fill(0).map((_, index) => { | ||
return <Cell key={index}>我是测试数据{index}</Cell> | ||
})} | ||
<BackTop threshold={100}> | ||
<div | ||
style={{ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
alignItems: 'center', | ||
}} | ||
> | ||
<Top size={12} /> | ||
<div style={{ fontSize: '12px' }}>顶部</div> | ||
</div> | ||
</BackTop> | ||
</div> | ||
) | ||
} | ||
export default Demo3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React from 'react' | ||
import { BackTop, Cell } from '@nutui/nutui-react-taro' | ||
import { Top } from '@nutui/icons-react-taro' | ||
|
||
const Demo4 = () => { | ||
const handleClick = () => { | ||
console.log('触发返回顶部') | ||
} | ||
const demoStyle = { | ||
height: 'auto', | ||
minHeight: 'auto', | ||
} | ||
return ( | ||
<div style={demoStyle} id="target"> | ||
{new Array(24).fill(0).map((_, index) => { | ||
return <Cell key={index}>我是测试数据{index}</Cell> | ||
})} | ||
<BackTop | ||
threshold={200} | ||
style={{ | ||
bottom: '50px', | ||
right: '20px', | ||
}} | ||
onClick={handleClick} | ||
> | ||
<div | ||
style={{ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
alignItems: 'center', | ||
}} | ||
> | ||
<Top size={12} /> | ||
<div style={{ fontSize: '12px' }}>顶部</div> | ||
</div> | ||
</BackTop> | ||
</div> | ||
) | ||
} | ||
export default Demo4 |
Oops, something went wrong.