Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add global pt option to PrimeVue config #3902

Closed
mertsincan opened this issue Apr 25, 2023 · 0 comments
Closed

Add global pt option to PrimeVue config #3902

mertsincan opened this issue Apr 25, 2023 · 0 comments
Assignees
Labels
Type: New Feature Issue contains a new feature or new component request
Milestone

Comments

@mertsincan
Copy link
Member

const globalPT = {
     `${componentName}`: ComponentPassThroughOptions
}

Exp;

const globalPT = {
    panel: {   // Panel Pass Through Options: https://primevue.org/panel
        root: { style: { fontWeight: 'bold' } },
        header: (slotProps) => {
            return {
                class: slotProps.state.d_collapsed ? 'bg-green-500' : 'bg-red-500',
                title: 'My Custom Panel Component',
                'data-toggleable': slotProps.props.toggleable,
                'data-collapsed': slotProps.state.d_collapsed
            };
        },
        title: { class: 'text-white' }
    },
    card: { // Card Pass Through Options: https://primevue.org/card
        body: { class: 'bg-cyan-300 border-round-lg' }
    }
};

export default defineNuxtPlugin((nuxtApp) => {
    nuxtApp.vueApp.use(PrimeVue, { pt: globalPT});
...
@mertsincan mertsincan added the Type: New Feature Issue contains a new feature or new component request label Apr 25, 2023
@mertsincan mertsincan added this to the 3.28.0 milestone Apr 25, 2023
@mertsincan mertsincan self-assigned this Apr 25, 2023
@mertsincan mertsincan changed the title Add global pt options to PrimeVue config Add global pt option to PrimeVue config Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: New Feature Issue contains a new feature or new component request
Projects
None yet
Development

No branches or pull requests

1 participant