primevue-mirror/doc/metergroup/MinMaxDoc.vue

70 lines
2.0 KiB
Vue
Raw Normal View History

2024-01-11 13:46:09 +00:00
<template>
<DocSectionText v-bind="$attrs">
<p>Boundaries are configured with the <i>min</i> and <i>max</i> values whose defaults are 0 and 100 respectively.</p>
</DocSectionText>
<div class="card">
2024-01-12 12:26:52 +00:00
<MeterGroup :value="value" :max="120" />
2024-01-11 13:46:09 +00:00
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
2024-01-12 12:26:52 +00:00
value: [
{ 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 12:26:52 +00:00
<MeterGroup :value="value" :max="120" />
2024-01-11 13:46:09 +00:00
`,
options: `
<template>
<div class="card">
2024-01-12 12:26:52 +00:00
<MeterGroup :value="value" :max="120" />
2024-01-11 13:46:09 +00:00
</div>
</template>
<script>
export default {
data() {
return {
2024-01-12 12:26:52 +00:00
value: [
{ 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 12:26:52 +00:00
<MeterGroup :value="value" :max="120" />
2024-01-11 13:46:09 +00:00
</div>
</template>
<script setup>
import { ref } from "vue";
2024-01-12 12:26:52 +00:00
const value = ref([
{ 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>