Skip to content

Commit

Permalink
chore: 移除 pull refresh 组件 使用例子
Browse files Browse the repository at this point in the history
  • Loading branch information
0x30 committed Jan 5, 2024
1 parent 530a782 commit 970f800
Showing 1 changed file with 1 addition and 52 deletions.
53 changes: 1 addition & 52 deletions src/views/detail/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineComponent } from 'vue'
import { NavPage, PullRefresh } from '@0x30/vue-navigation-layout'
import { NavPage } from '@0x30/vue-navigation-layout'
import { back, useLeaveBefore } from '@0x30/vue-navigation'

import { useConfirm } from '../alert'
Expand All @@ -13,63 +13,12 @@ const Component = defineComponent({
/// 返回的时候 先弹出框询问用户
useLeaveBefore(useConfirm)

const refresh = () => {
return new Promise<void>((resolve) => {
window.setTimeout(resolve, 1000)
})
}

return () => (
<NavPage class={styles.body}>
detail
<div>
<button onClick={back}>back</button>
</div>
<PullRefresh
class={styles.contain}
finishKeeyTime={500}
onRefresh={async () => {
await refresh()
console.log('刷新完成')
}}
refreshingRender={() => {
return (
<div key={1} class={styles.header}>
刷新中
</div>
)
}}
pullingRender={(progress) => {
return (
<div key={1} class={styles.header}>
加油啊{progress}
</div>
)
}}
waitReleaseRender={() => {
return (
<div key={1} class={styles.header}>
松开我就可以刷新了
</div>
)
}}
finishRender={() => {
return (
<div key={1} class={styles.header}>
完成
</div>
)
}}
>
<div style={{ height: '300px', background: 'green' }}>xxx</div>
<div style={{ height: '300px', background: 'pink' }}>xxx</div>
<div style={{ height: '300px', background: 'blue' }}>xxx</div>
<div style={{ height: '300px', background: 'red' }}>xxx</div>
<div style={{ height: '300px', background: 'green' }}>xxx</div>
<div style={{ height: '300px', background: 'pink' }}>xxx</div>
<div style={{ height: '300px', background: 'blue' }}>xxx</div>
<div style={{ height: '300px', background: 'red' }}>xxx</div>
</PullRefresh>
</NavPage>
)
},
Expand Down

0 comments on commit 970f800

Please sign in to comment.