feat: 添加 UseIntersectionObserverInfiniteLoading 组件的使用示例,优化模板结构 [no-ci]
This commit is contained in:
@ -17,6 +17,19 @@ function checkIsVisible(el: Element, root: Element | null = null) {
|
||||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* @example
|
||||
*
|
||||
* ```ts
|
||||
* const list = ref<Record<string, never>[]>([]);
|
||||
* const loadData = async (page: number) => { ... };
|
||||
* ```
|
||||
*
|
||||
* ```vue
|
||||
* <UseIntersectionObserverInfiniteLoading :async-load="loadData" ref="infiniteLoading" />
|
||||
* ```
|
||||
*/
|
||||
|
||||
const props = defineProps<{
|
||||
asyncLoad: (page: number) => Promise<{ hasMore: boolean }>;
|
||||
}>();
|
||||
|
Reference in New Issue
Block a user