A plugin developed with Vue 3 and vite.js.
Using npm:
npm install @mustafadalga/loading-spinner
Then, import and register the component:
main.js
import Loader from "@mustafadalga/loading-spinner";
import "@mustafadalga/loading-spinner/style.css"
app.use(Loader);
- Composition Api
<script setup>
import { Loader } from "@mustafadalga/loading-spinner";
import "@mustafadalga/loading-spinner/style.css";
</script>
- Options Api
import { Loader } from "@mustafadalga/loading-spinner";
import "@mustafadalga/loading-spinner/style.css";
export default {
components: {
Loader
},
}
- Example 1
<script setup>
import icon from './assets/icons/icon.svg'
</script>
<template>
<main>
<Loader :icon="icon"/>
</main>
</template>
- Example 2
<script>
import icon from './assets/icons/icon.svg'
export default {
data () {
return {
icon: icon
}
}
}
</script>
<template>
<main>
<Loader :icon="icon"/>
</main>
</template>
- Example 3
<script setup>
import icon from './assets/icons/icon.svg'
</script>
<template>
<main>
<Loader :icon="icon">
<template #description>
Please Wait...
</template>
</Loader>
</main>
</template>