oumoussa98 / vue3-infinite-loading

Infinite scroll component compatible with vuejs-3 and vitejs
https://vue3-infinite-loading.netlify.app/
191 stars 31 forks source link

Customizing spinner #7

Closed hellagirrl closed 2 years ago

hellagirrl commented 2 years ago

Hi! I was wondering is there any way to customize a spinner? E.g. by implementing bootstrap spinner-border? I tried doing it like this:

    <InfiniteLoading :tableData="tableData" @infinite="load">
         <div class="text-center pt-5 my-loading">
             <div class="spinner-border" role="status">
                 <span class="visually-hidden">Loading...</span>
             </div>
         </div>
    </InfiniteLoading>

But it isn't working.

hellagirrl commented 2 years ago

Figured out how to implement this:

      <div class="text-center py-5 my-loading">
        <div class="spinner-border" role="status">
          <span class="visually-hidden">Loading...</span>
          <InfiniteLoading
            :tableData="tableData"
            @infinite="load"
            style="display: none"
          />
        </div>
      </div>
oumoussa98 commented 2 years ago

hello @hellagirrl. You can easily override the default spinner using slots

<InfinteLoading>
  <template #spinner>
      <h1>loading...</h1>
   </template>
</InfiniteLoading>