primevue-mirror/packages/primevue/src/progressbar/ProgressBar.vue

35 lines
1.0 KiB
Vue
Raw Normal View History

2022-09-06 12:03:37 +00:00
<template>
2024-02-11 23:48:21 +00:00
<div role="progressbar" :class="cx('root')" aria-valuemin="0" :aria-valuenow="value" aria-valuemax="100" v-bind="ptmi('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-else-if="indeterminate" :class="cx('value')" v-bind="ptm('value')"></div>
2022-09-06 12:03:37 +00:00
</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,
2024-02-11 23:48:21 +00:00
inheritAttrs: false,
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>