primevue-mirror/doc/metergroup/LabelDoc.vue

73 lines
2.2 KiB
Vue
Raw Normal View History

2024-01-11 13:46:09 +00:00
<template>
<DocSectionText v-bind="$attrs">
<p>
2024-01-12 09:53:18 +00:00
Default layout of MeterGroup is <i>horizontal</i>, and also <i>labelOrientation</i> property can be set as <i>vertical</i>.In addition, position of the label can be changed using <i>labelPosition</i> property that the default value is
2024-01-11 13:46:09 +00:00
<i>end</i> and also <i>start</i> option is available.
</p>
</DocSectionText>
<div class="card">
2024-01-12 09:53:18 +00:00
<MeterGroup :value="value" labelPosition="start" />
2024-01-11 13:46:09 +00:00
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
value: [
2024-01-12 09:53:18 +00:00
{ label: 'Apps', value: 16, color: '#EB9A9C', icon: 'pi pi-cog' },
{ label: 'Messages', value: 8, color: '#FFCF91', icon: 'pi pi-envelope' },
{ label: 'Media', value: 24, color: '#93DEAC', icon: 'pi pi-image' },
{ label: 'System Data', value: 20, color: '#91cff8', icon: 'pi pi-database' }
2024-01-11 13:46:09 +00:00
],
code: {
basic: `
2024-01-12 09:53:18 +00:00
<MeterGroup :value="value" labelPosition="start" />
2024-01-11 13:46:09 +00:00
`,
options: `
<template>
<div class="card">
2024-01-12 09:53:18 +00:00
<MeterGroup :value="value" labelPosition="start" />
2024-01-11 13:46:09 +00:00
</div>
</template>
<script>
export default {
data() {
return {
value: [
2024-01-12 09:53:18 +00:00
{ label: 'Apps', value: 16, color: '#EB9A9C', icon: 'pi pi-cog' },
{ label: 'Messages', value: 8, color: '#FFCF91', icon: 'pi pi-envelope' },
{ label: 'Media', value: 24, color: '#93DEAC', icon: 'pi pi-image' },
{ label: 'System Data', value: 20, color: '#91cff8', icon: 'pi pi-database' }
2024-01-11 13:46:09 +00:00
]
};
}
};
<\/script>
`,
composition: `
<template>
<div class="card">
2024-01-12 09:53:18 +00:00
<MeterGroup :value="value" labelPosition="start" />
2024-01-11 13:46:09 +00:00
</div>
</template>
<script setup>
import { ref } from "vue";
const value = ref([
2024-01-12 09:53:18 +00:00
{ label: 'Apps', value: 16, color: '#EB9A9C', icon: 'pi pi-cog' },
{ label: 'Messages', value: 8, color: '#FFCF91', icon: 'pi pi-envelope' },
{ label: 'Media', value: 24, color: '#93DEAC', icon: 'pi pi-image' },
{ label: 'System Data', value: 20, color: '#91cff8', icon: 'pi pi-database' }
2024-01-11 13:46:09 +00:00
]);
<\/script>
`
}
};
}
};
</script>