primevue-mirror/doc/chart/theming/TailwindDoc.vue

53 lines
1.5 KiB
Vue
Raw Normal View History

<template>
<DocSectionText v-bind="$attrs">
<p>
PrimeVue offers a built-in Tailwind theme to get you started quickly. The default values related to the component are displayed below. The component can easily be styled with your own design based on Tailwind utilities, see the
2023-08-07 12:40:22 +00:00
<PrimeVueNuxtLink to="/tailwind">Tailwind Customization</PrimeVueNuxtLink> section for an example.
</p>
2023-08-16 13:58:31 +00:00
<p class="mt-4">A playground sample with the pre-built Tailwind theme.</p>
2023-12-05 10:14:27 +00:00
<DocSectionCode :code="code" :dependencies="{ 'chart.js': '3.3.2' }" component="Chart" embedded />
</DocSectionText>
</template>
<script>
export default {
data() {
return {
2023-12-05 10:14:27 +00:00
code: {
2023-09-22 12:54:14 +00:00
composition: `
<template>
<div class="card">
<Chart type="bar" :data="chartData" :options="chartOptions" />
</div>
</template>
<script setup>
import { ref } from "vue";
const chartData = ref({
labels: ['Q1', 'Q2', 'Q3', 'Q4'],
datasets: [
{
label: 'Sales',
data: [540, 325, 702, 620],
backgroundColor: ['rgba(255, 159, 64, 0.2)', 'rgba(75, 192, 192, 0.2)', 'rgba(54, 162, 235, 0.2)', 'rgba(153, 102, 255, 0.2)'],
borderColor: ['rgb(255, 159, 64)', 'rgb(75, 192, 192)', 'rgb(54, 162, 235)', 'rgb(153, 102, 255)'],
borderWidth: 1
}
]
});
const chartOptions = ref({
scales: {
y: {
beginAtZero: true
}
}
});
2023-10-15 09:38:39 +00:00
<\/script>
`
}
};
}
};
</script>