mirror of
https://github.com/element-plus/element-plus.git
synced 2025-08-14 18:11:48 +08:00

* feat(components): [scrollbar] add `end-reached` attribute * chore: cleanup * wip * wip * wip * Revert "wip" This reverts commit e0da0a2d5345fd133176a5a7895f612a74c17920. * Revert "wip" This reverts commit 805988eec71e10287012a91cbd0d3269f9541d0b. * Revert "wip" This reverts commit 4f15391dd268eec45e006d292f9fde0dde90de71. * Revert "chore: cleanup" This reverts commit c0a82c4d56410389bb7e64657907ce7ffb6de82c. * Revert "feat(components): [scrollbar] add `end-reached` attribute" This reverts commit 92e9533d1bbb6631d6f816a5894cf978ad4dada4. * chore: add emit attempt * Update docs/en-US/component/scrollbar.md Co-authored-by: kooriookami <38392315+kooriookami@users.noreply.github.com> * Update docs/en-US/component/scrollbar.md Co-authored-by: kooriookami <38392315+kooriookami@users.noreply.github.com> * Update docs/en-US/component/scrollbar.md Co-authored-by: kooriookami <38392315+kooriookami@users.noreply.github.com> * Update packages/components/scrollbar/src/scrollbar.vue Co-authored-by: btea <2356281422@qq.com> * Update packages/components/scrollbar/src/scrollbar.ts * fix: update * fix: update test * docs: format * fix: drag scroll --------- Co-authored-by: kooriookami <38392315+kooriookami@users.noreply.github.com> Co-authored-by: btea <2356281422@qq.com> Co-authored-by: warmthsea <2586244885@qq.com>
39 lines
751 B
Vue
39 lines
751 B
Vue
<template>
|
|
<el-scrollbar height="400px" @end-reached="loadMore">
|
|
<p v-for="item in num" :key="item" class="scrollbar-demo-item">
|
|
{{ item }}
|
|
</p>
|
|
</el-scrollbar>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { ref } from 'vue'
|
|
|
|
import type { ScrollbarDirection } from 'element-plus'
|
|
|
|
const num = ref(30)
|
|
|
|
const loadMore = (direction: ScrollbarDirection) => {
|
|
if (direction === 'bottom') {
|
|
num.value += 5
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.scrollbar-demo-item {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
height: 50px;
|
|
margin: 10px;
|
|
text-align: center;
|
|
border-radius: 4px;
|
|
background: var(--el-color-primary-light-9);
|
|
color: var(--el-color-primary);
|
|
}
|
|
.el-slider {
|
|
margin-top: 20px;
|
|
}
|
|
</style>
|