Skip to content

Commit

Permalink
Fixed for Options API
Browse files Browse the repository at this point in the history
  • Loading branch information
eeprojectsee committed Sep 6, 2022
1 parent 5650271 commit 1a1c6fd
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 5 deletions.
48 changes: 45 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
# Vue3 Progress Bar

A infinite progress bar for vue 3
![npm license](https://img.shields.io/npm/l/@ctechhindi/vue3-progress-bar.svg)
![npm download](https://img.shields.io/npm/dm/@ctechhindi/vue3-progress-bar.svg)
![GitHub top language](https://img.shields.io/github/languages/top/ctechhindi/vue3-progress-bar.svg)
![GitHub issues](https://img.shields.io/github/issues/ctechhindi/vue3-progress-bar.svg)
[![npm package](https://img.shields.io/npm/v/@ctechhindi/vue3-progress-bar.svg)](https://www.npmjs.com/package/@ctechhindi/vue3-progress-bar)

> A infinite progress bar for vue 3
- [GitHub](https://github.com/ctechhindi/Vue3-Progress-Bar)

## Requirements

- Vue.js `^3.0.0`

## Installation

### npm
Expand All @@ -28,12 +38,14 @@ app.use(Vue3ProgressBar, {
// background: "linear-gradient(45deg, #da7748, #d11111)",
// left: "0 %",
// },
})
});
```

**`App.vue`**

```vue
<!-- Composition API -->
<script setup>
import { onMounted, inject } from "vue";
import { useRouter } from "vue-router";
Expand Down Expand Up @@ -61,6 +73,36 @@ onMounted(async () => {
</template>
```

```vue
<!-- Options API -->
<template>
<div id="app">
<Vue3ProgressBar></Vue3ProgressBar>
<RouterView />
</div>
</template>
<script>
export default {
mounted() {
this.$progress.finish();
},
created() {
this.$progress.start();
this.$router.beforeEach((to, from, next) => {
this.$progress.start();
next();
});
this.$router.afterEach((to, from) => {
this.$progress.finish();
});
},
};
</script>
```

# License

[MIT License](https://opensource.org/licenses/MIT)
[MIT License](https://opensource.org/licenses/MIT)
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ctechhindi/vue3-progress-bar",
"version": "1.0.4",
"version": "1.0.5",
"description": "A infinite progress bar for vue 3",
"homepage": "https://github.com/ctechhindi/Vue3-Progress-Bar",
"bugs": "https://github.com/ctechhindi/Vue3-Progress-Bar/issues",
Expand All @@ -19,7 +19,9 @@
},
"keywords": [
"vue3",
"progress-bar"
"progress-bar",
"progress bar",
"vue"
],
"author": "Jeevan Lal",
"license": "MIT",
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ function install(app, options = {}) {
// Vue Component
app.provide('VUE3_PROGRESS_BAR_DATA', VUE3_PROGRESS_BAR_DATA);
app.provide('progress', progress)
app.config.globalProperties.$progress = progress;
app.component("Vue3ProgressBar", Vue3ProgressBar);
}

Expand Down

0 comments on commit 1a1c6fd

Please sign in to comment.