forked from epicmaxco/vuestic-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix/bugs 2.0: update progress bar presentation (epicmaxco#690)
* fix(bugs-2.0): change progress bar presentation * fix(bugs-2.0): change progress bar presentation * fix(bugs-2.0): minor changes
- Loading branch information
1 parent
448c224
commit ff7cf04
Showing
5 changed files
with
79 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
src/components/statistics/progress-bars/Widgets/BarsState.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<template> | ||
<va-card | ||
class="bars-state" | ||
:title="$t('progressBars.state')" | ||
> | ||
<div class="row"> | ||
<div class="flex md4 xs12"> | ||
<va-progress-bar :value="value2">66%</va-progress-bar> | ||
</div> | ||
<div class="flex md4 xs12"> | ||
<va-progress-bar | ||
:value="bufferValues.value" | ||
:buffer="bufferValues.buffer" | ||
>Buffering | ||
</va-progress-bar> | ||
</div> | ||
<div class="flex md4 xs12"> | ||
<va-progress-bar indeterminate>Loading</va-progress-bar> | ||
</div> | ||
</div> | ||
</va-card> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'bars-state', | ||
data () { | ||
return { | ||
value2: 66, | ||
bufferValues: { | ||
value: 0, | ||
buffer: 0, | ||
}, | ||
} | ||
}, | ||
mounted () { | ||
this.animateValue() | ||
this.animateBufferValues() | ||
}, | ||
methods: { | ||
animateValue () { | ||
setTimeout(() => { | ||
this.value = 100 | ||
}) | ||
}, | ||
animateBufferValues () { | ||
const interval = setInterval(() => { | ||
this.bufferValues.value += 2 + Math.floor(Math.random() * 2) | ||
this.bufferValues.buffer += 2 + Math.floor(Math.random() * 4) | ||
if (this.bufferValues.value >= 100) { | ||
clearInterval(interval) | ||
} | ||
}, 400) | ||
}, | ||
}, | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters