primevue-mirror/apps/showcase/doc/metergroup/LabelDoc.vue

73 lines
2.0 KiB
Vue
Raw Normal View History

2024-01-11 13:46:09 +00:00
<template>
<DocSectionText v-bind="$attrs">
<p>
2024-02-04 16:11:37 +00:00
The position of the labels relative to the meters is defined using the <i>labelPosition</i> property. The default orientation of the labels is horizontal, and the vertical alternative is available through the
<i>labelOrientation</i> option.
2024-01-11 13:46:09 +00:00
</p>
</DocSectionText>
<div class="card">
2024-02-04 16:11:37 +00:00
<MeterGroup :value="value" labelPosition="start" labelOrientation="vertical" />
2024-01-11 13:46:09 +00:00
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
value: [
2024-02-04 16:11:37 +00:00
{ label: 'Apps', color: '#34d399', value: 16 },
{ label: 'Messages', color: '#fbbf24', value: 8 },
{ label: 'Media', color: '#60a5fa', value: 24 },
{ label: 'System', color: '#c084fc', value: 10 }
2024-01-11 13:46:09 +00:00
],
code: {
basic: `
2024-02-04 16:11:37 +00:00
<MeterGroup :value="value" labelPosition="start" labelOrientation="vertical" />
2024-01-11 13:46:09 +00:00
`,
options: `
<template>
<div class="card">
2024-02-04 16:11:37 +00:00
<MeterGroup :value="value" labelPosition="start" labelOrientation="vertical" />
2024-01-11 13:46:09 +00:00
</div>
</template>
<script>
export default {
data() {
return {
value: [
2024-02-04 16:11:37 +00:00
{ label: 'Apps', color: '#34d399', value: 16 },
{ label: 'Messages', color: '#fbbf24', value: 8 },
{ label: 'Media', color: '#60a5fa', value: 24 },
{ label: 'System', color: '#c084fc', value: 10 }
2024-01-11 13:46:09 +00:00
]
};
}
};
<\/script>
`,
composition: `
<template>
<div class="card">
2024-02-04 16:11:37 +00:00
<MeterGroup :value="value" labelPosition="start" labelOrientation="vertical" />
2024-01-11 13:46:09 +00:00
</div>
</template>
<script setup>
import { ref } from "vue";
const value = ref([
2024-02-04 16:11:37 +00:00
{ label: 'Apps', color: '#34d399', value: 16 },
{ label: 'Messages', color: '#fbbf24', value: 8 },
{ label: 'Media', color: '#60a5fa', value: 24 },
{ label: 'System', color: '#c084fc', value: 10 }
2024-01-11 13:46:09 +00:00
]);
<\/script>
`
}
};
}
};
</script>