primevue-mirror/components/lib/progressbar/ProgressBar.vue

36 lines
1.1 KiB
Vue
Raw Normal View History

2022-09-06 12:03:37 +00:00
<template>
<div role="progressbar" :class="cx('root')" aria-valuemin="0" :aria-valuenow="value" aria-valuemax="100" v-bind="ptm('root')">
<div v-if="determinate" :class="cx('value')" :style="progressStyle" v-bind="ptm('value')">
<div v-if="value != null && value !== 0 && showValue" :class="cx('label')" v-bind="ptm('label')">
2022-09-14 11:26:01 +00:00
<slot>{{ value + '%' }}</slot>
</div>
2022-09-06 12:03:37 +00:00
</div>
<div v-if="indeterminate" :class="cx('container')" v-bind="ptm('container')">
<div :class="cx('value')" v-bind="ptm('value')"></div>
2022-09-06 12:03:37 +00:00
</div>
</div>
</template>
<script>
2023-05-25 16:32:25 +00:00
import BaseProgressBar from './BaseProgressBar.vue';
2023-04-21 13:34:40 +00:00
2022-09-06 12:03:37 +00:00
export default {
name: 'ProgressBar',
2023-05-25 16:32:25 +00:00
extends: BaseProgressBar,
2022-09-06 12:03:37 +00:00
computed: {
progressStyle() {
return {
width: this.value + '%',
display: 'flex'
};
},
indeterminate() {
return this.mode === 'indeterminate';
},
determinate() {
return this.mode === 'determinate';
}
}
2022-09-14 11:26:01 +00:00
};
2022-09-06 12:03:37 +00:00
</script>