1.0.12 • Published 1 year ago

loader-quark v1.0.12

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

Loader Quark

This quark is a simple vue plugin with a loader component.

Installation

npm install loader-quark --save

Setup

main.js

//...
import {Loader} from "loader-quark"
import "loader-quark/dist/style.css"

//...
const app = createApp(App)
//...

app.use(Loader)

Import the quark and its styles in the main javascript file and use it as a plugin in your app.

Basic Usage

AnyComponent.js

<script setup>
   //...
   const loading = ref(false)
   
   // Perform some data loading, for example some api call
   try {
       loading.value = true // Set loading to true in the beginning
       const response = await fetch('https://api.example.com/data')
       const data = await response.json()
   } catch (error) {
       console.error(error)
   } finally {
       loading.value = false // After the data is loaded, set loading to false
   }
</script>

<template>
   <Loader v-if="loading" type="spinner" primary-color="#7842f5"/>
   <div v-else>
      <!-- ... -->
   </div>
</template>

You can use easy conditional rendering to display the loader component for example when waiting for your data to load from backend.

DOCS

Full docs at https://www.quarksjs.com/library/loader-quark/getting-started.

Source code at https://github.com/SamuelSlavik/LoaderQuark

SUPPORT

Please support us by starring the repository or donate at https://www.quarksjs.com/donate to help us maintain the project and cover hosting expenses.

1.0.2

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.12

1 year ago

1.0.1

1 year ago