<script setup>
import xtxInfiniteLoading from '../packages/components/xtx-infinite-loading.vue'
import { ref } from 'vue'

const loading = ref(false)
const finished = ref(false)

const sleep = time =>
  new Promise(resolve => {
    setTimeout(resolve, time)
  })

const infinite = async () => {
  loading.value = true
  await sleep(3000)
  loading.value = false
  finished.value = true
}
</script>

<template>
  <xtx-infinite-loading
    :loading="loading"
    :finished="finished"
    @infinite="infinite"
  ></xtx-infinite-loading>
</template>

<style scoped lang="less"></style>
