Skip to content

Commit

Permalink
refactor: fixed the problem that the scroll component could not remem…
Browse files Browse the repository at this point in the history
…ber the height
  • Loading branch information
zyronon committed May 3, 2024
1 parent de415ae commit d2b532a
Show file tree
Hide file tree
Showing 8 changed files with 146 additions and 268 deletions.
6 changes: 3 additions & 3 deletions src/components/BaseButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 51,7 @@ export default {
},
radius: {
type: String,
default: '3'
default: '6'
}
},
data() {
Expand Down Expand Up @@ -159,9 159,9 @@ export default {
}
&.white {
background: white;
background: white !important;
color: black;
border: 1px solid gainsboro;
border: 1px solid gainsboro !important;
}
&.info {
Expand Down
2 changes: 1 addition & 1 deletion src/components/NoMore.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 14,7 @@ export default {
@import '../assets/less/index';
.NoMore {
font-size: 12rem;
font-size: 13rem;
height: 60rem;
display: flex;
align-items: center;
Expand Down
9 changes: 8 additions & 1 deletion src/components/ScrollList.vue
Original file line number Diff line number Diff line change
@@ -1,5 1,10 @@
<template>
<Scroll :loading="state.loading" :full-loading="!state.list.length" @pulldown="loadData">
<Scroll
ref="scroll"
:loading="state.loading"
:full-loading="!state.list.length"
@pulldown="loadData"
>
<slot :list="state.list"></slot>
<NoMore v-if="state.total !== 0 && state.total === state.list.length" />
</Scroll>
Expand All @@ -10,6 15,7 @@ import { onMounted, reactive } from 'vue'
import { _notice } from '@/utils'
import Scroll from '@/components/Scroll.vue'
import NoMore from '@/components/NoMore.vue'
import { useScroll } from '@/utils/hooks/useScroll.ts'
const props = defineProps({
api: {
Expand All @@ -19,6 25,7 @@ const props = defineProps({
}
}
})
const scroll = useScroll()
const state = reactive({
list: [],
Expand Down
8 changes: 6 additions & 2 deletions src/pages/me/RequestUpdate.vue
Original file line number Diff line number Diff line change
@@ -1,6 1,6 @@
<template>
<div class="RequestUpdate" id="RequestUpdate">
<BaseHeader>
<BaseHeader :is-fixed="false">
<template v-slot:center>
<span class="f16">求更新</span>
</template>
Expand Down Expand Up @@ -112,9 112,13 @@ function toggleRequestUpdate() {
overflow: auto;
color: white;
font-size: 14rem;
display: flex;
flex-direction: column;
.content {
padding: 60rem 15rem 60rem 15rem;
flex: 1;
overflow: auto;
padding: 15rem 15rem 60rem 15rem;
.none {
display: flex;
Expand Down
Loading

0 comments on commit d2b532a

Please sign in to comment.