-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[web] Use default Bulma progress bar styles
- Loading branch information
1 parent
7fcc047
commit b2ee4f3
Showing
2 changed files
with
12 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,21 @@ | ||
<template> | ||
<div | ||
v-if="width > 0" | ||
class="progress-bar" | ||
:style="{ width: width_percent }" | ||
<progress | ||
v-if="value > 0" | ||
class="progress is-info" | ||
:value="value" | ||
:max="max" | ||
/> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'ProgressBar', | ||
props: ['max', 'value'], | ||
computed: { | ||
width() { | ||
if (this.value > 0 && this.max > 0) { | ||
return parseInt((this.value * 100) / this.max) | ||
} | ||
return 0 | ||
}, | ||
width_percent() { | ||
return `${this.width}%` | ||
} | ||
} | ||
props: ['max', 'value'] | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.progress { | ||
height: 0.25rem; | ||
} | ||
</style> |
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