Skip to content

Commit

Permalink
progress-bar
Browse files Browse the repository at this point in the history
  • Loading branch information
mapsandapps committed Dec 15, 2023
1 parent d0aeb8f commit faed9d1
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 73 deletions.
43 changes: 17 additions & 26 deletions static/usage/v7/progress-bar/buffer/vue.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,27 @@
<ion-progress-bar :buffer="buffer" :value="progress"></ion-progress-bar>
</template>

<script lang="ts">
<script lang="ts" setup>
import { IonProgressBar } from '@ionic/vue';
import { defineComponent, ref } from 'vue';
import { onMounted, ref } from 'vue';
export default defineComponent({
components: { IonProgressBar },
setup() {
let buffer = ref(0.06);
let progress = ref(0);
const buffer = ref(0.06);
const progress = ref(0);
return {
buffer,
progress,
};
},
mounted() {
setInterval(() => {
this.buffer += 0.06;
this.progress += 0.06;
onMounted(() => {
setInterval(() => {
buffer.value += 0.06;
progress.value += 0.06;
// Reset the progress bar when it reaches 100%
// to continuously show the demo
if (this.progress > 1) {
setTimeout(() => {
this.buffer = 0.06;
this.progress = 0;
}, 1000);
}
}, 1000);
},
// Reset the progress bar when it reaches 100%
// to continuously show the demo
if (progress.value > 1) {
setTimeout(() => {
buffer.value = 0.06;
progress.value = 0;
}, 1000);
}
}, 1000);
});
</script>
```
37 changes: 14 additions & 23 deletions static/usage/v7/progress-bar/determinate/vue.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,23 @@
<ion-progress-bar :value="progress"></ion-progress-bar>
</template>

<script lang="ts">
<script lang="ts" setup>
import { IonProgressBar } from '@ionic/vue';
import { defineComponent, ref } from 'vue';
import { onMounted, ref } from 'vue';
export default defineComponent({
components: { IonProgressBar },
setup() {
let progress = ref(0);
const progress = ref(0);
onMounted(() => {
setInterval(() => {
progress.value += 0.01;
return {
progress,
};
},
mounted() {
setInterval(() => {
this.progress += 0.01;
// Reset the progress bar when it reaches 100%
// to continuously show the demo
if (this.progress > 1) {
setTimeout(() => {
this.progress = 0;
}, 1000);
}
}, 50);
},
// Reset the progress bar when it reaches 100%
// to continuously show the demo
if (progress.value > 1) {
setTimeout(() => {
progress.value = 0;
}, 1000);
}
}, 50);
});
</script>
```
7 changes: 1 addition & 6 deletions static/usage/v7/progress-bar/indeterminate/vue.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
<ion-progress-bar type="indeterminate"></ion-progress-bar>
</template>

<script lang="ts">
<script lang="ts" setup>
import { IonProgressBar } from '@ionic/vue';
import { defineComponent } from 'vue';
export default defineComponent({
components: { IonProgressBar },
});
</script>
```
7 changes: 1 addition & 6 deletions static/usage/v7/progress-bar/theming/colors/vue.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@
<ion-progress-bar type="indeterminate" color="dark"></ion-progress-bar>
</template>

<script lang="ts">
<script lang="ts" setup>
import { IonProgressBar } from '@ionic/vue';
import { defineComponent } from 'vue';
export default defineComponent({
components: { IonProgressBar },
});
</script>
```
7 changes: 1 addition & 6 deletions static/usage/v7/progress-bar/theming/css-properties/vue.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@
<ion-progress-bar type="indeterminate"></ion-progress-bar>
</template>

<script lang="ts">
<script lang="ts" setup>
import { IonProgressBar } from '@ionic/vue';
import { defineComponent } from 'vue';
export default defineComponent({
components: { IonProgressBar },
});
</script>

<style scoped>
Expand Down
7 changes: 1 addition & 6 deletions static/usage/v7/progress-bar/theming/css-shadow-parts/vue.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@
<ion-progress-bar type="indeterminate"></ion-progress-bar>
</template>

<script lang="ts">
<script lang="ts" setup>
import { IonProgressBar } from '@ionic/vue';
import { defineComponent } from 'vue';
export default defineComponent({
components: { IonProgressBar },
});
</script>

<style scoped>
Expand Down

0 comments on commit faed9d1

Please sign in to comment.