primevue-mirror/doc/passthrough/GlobalDoc.vue

42 lines
1.1 KiB
Vue
Raw Normal View History

2023-07-09 21:13:49 +00:00
<template>
<DocSectionText v-bind="$attrs">
<p>
Defines the shared pass through properties per component type. For example, with the configuration below all panel headers have the <i>bg-primary</i> style class and the all autocomplete components have a fixed width. These settings can
be overriden by a particular component as components <i>pt</i> property has higher precedence over global <i>pt</i>.
</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, {
2023-07-09 21:13:49 +00:00
pt: {
panel: {
2023-07-11 23:14:34 +00:00
header: {
2024-05-20 12:14:38 +00:00
class: 'bg-primary text-primary-contrast'
2023-07-11 23:14:34 +00:00
}
2023-07-09 21:13:49 +00:00
},
autocomplete: {
2024-01-30 08:16:35 +00:00
input: {
2024-05-20 12:14:38 +00:00
root: 'w-64' // OR { class: 'w-64' }
2023-07-11 23:14:34 +00:00
}
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>