primevue-mirror/components/lib/metergroup/MeterGroupLabel.vue

37 lines
1.2 KiB
Vue
Raw Normal View History

2024-01-18 12:53:33 +00:00
<template>
2024-04-30 06:54:48 +00:00
<ol :class="cx('labelList')" v-bind="ptm('labelList')">
<li v-for="(val, index) in value" :key="index + '_label'" :class="cx('label')" v-bind="ptm('label')">
<slot name="icon" :value="val" :class="cx('labelIcon')">
<i v-if="val.icon" :class="[val.icon, cx('labelIcon')]" :style="{ color: val.color }" v-bind="ptm('labelIcon')" />
<span v-else :class="cx('labelMarker')" :style="{ backgroundColor: val.color }" v-bind="ptm('labelMarker')" />
2024-01-18 12:53:33 +00:00
</slot>
2024-04-30 06:54:48 +00:00
<span :class="cx('labelText')" v-bind="ptm('labelText')">{{ val.label }} ({{ $parentInstance.percentValue(val.value) }})</span>
2024-01-18 12:53:33 +00:00
</li>
</ol>
</template>
<script>
import BaseComponent from 'primevue/basecomponent';
export default {
name: 'MeterGroupLabel',
hostName: 'MeterGroup',
extends: BaseComponent,
inheritAttrs: false,
props: {
value: {
type: Array,
default: null
},
labelPosition: {
type: String,
default: 'end'
},
labelOrientation: {
type: String,
default: 'horizontal'
}
}
};
</script>