primevue-mirror/apps/showcase/doc/theming/unstyled/pure/PureGlobalDoc.vue

44 lines
1.3 KiB
Vue
Raw Normal View History

2023-07-09 21:13:49 +00:00
<template>
<DocSectionText v-bind="$attrs">
<p>
2024-10-29 09:24:51 +00:00
A global configuration can be created at application level to avoid repetition via the global <i>pt</i> option so that the styles can be shared from a single location. A particular component can still override a global configuration with
its own <i>pt</i> property.
2023-07-09 21:13:49 +00:00
</p>
</DocSectionText>
2024-01-30 08:16:35 +00:00
<DocSectionCode :code="code" hideToggleCode importCode hideStackBlitz />
2023-07-09 21:13:49 +00:00
</template>
<script>
export default {
data() {
return {
code: {
2023-09-22 12:54:14 +00:00
basic: `
import { createApp } from "vue";
2023-07-09 21:13:49 +00:00
import PrimeVue from "primevue/config";
const app = createApp(App);
2024-01-30 08:16:35 +00:00
app.use(PrimeVue, {
2024-10-29 09:24:51 +00:00
unstyled: true,
2023-07-09 21:13:49 +00:00
pt: {
button: {
2024-10-29 09:24:51 +00:00
root: 'bg-teal-500 hover:bg-teal-700 active:bg-teal-900 cursor-pointer py-2 px-4 rounded-full border-0 flex gap-2',
label: 'text-white font-bold text-lg',
icon: 'text-white text-xl'
2023-07-09 21:13:49 +00:00
},
panel: {
2024-05-20 12:14:38 +00:00
header: 'bg-primary text-primary-contrast border-primary',
2023-07-11 23:14:34 +00:00
content: 'border-primary text-lg text-primary-700',
2024-05-20 12:14:38 +00:00
title: 'bg-primary text-primary-contrast text-xl',
toggler: 'bg-primary text-primary-contrast hover:text-primary hover:bg-primary-contrast'
2023-07-09 21:13:49 +00:00
}
2024-01-30 08:16:35 +00:00
}
2023-09-22 12:54:14 +00:00
});
`
2023-07-09 21:13:49 +00:00
}
};
}
};
</script>