Loading Component
A plugin developed with Vue 3 and vite.js.
Installing
Package manager
Using npm:
npm install @mustafadalga/loading-spinner
Then, import and register the component:
Global Registration
main.js
import Loader from "@mustafadalga/loading-spinner";
import "@mustafadalga/loading-spinner/style.css"
app.use(Loader);
Local Registration
<script setup>
import { Loader } from "@mustafadalga/loading-spinner";
import "@mustafadalga/loading-spinner/style.css";
</script>
import { Loader } from "@mustafadalga/loading-spinner";
import "@mustafadalga/loading-spinner/style.css";
export default {
components: {
Loader
},
}
Usage
<script setup>
import icon from './assets/icons/icon.svg'
</script>
<template>
<main>
<Loader :icon="icon"/>
</main>
</template>
<script>
import icon from './assets/icons/icon.svg'
export default {
data () {
return {
icon: icon
}
}
}
</script>
<template>
<main>
<Loader :icon="icon"/>
</main>
</template>
<script setup>
import icon from './assets/icons/icon.svg'
</script>
<template>
<main>
<Loader :icon="icon">
<template #description>
Please Wait...
</template>
</Loader>
</main>
</template>
Demo
License