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

Method for providing extra props? #231

Open
aDogCalledSpot opened this issue Apr 26, 2024 · 0 comments
Open

Method for providing extra props? #231

aDogCalledSpot opened this issue Apr 26, 2024 · 0 comments

Comments

@aDogCalledSpot
Copy link

Is it currently possible or are there plans to support adding extra props to a component that can then be passed on to the passthrough arguments?

Example:

Most of my Panels are only text, so I have some padding for the content:

content: {
  class: 'p-4 sm:p-6'
}

I would like the possibility to also have panels with no margins since that works better for some content.

Ideally I would be able to do something like this:

// MyComponent.vue
<Panel noMargin header="Foo">
  <AnotherComponent />
</Panel>

and then change my preset to the following:

content: {
  class: [
    { 'p-4 sm:p-6': props.noMargin !== true }
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant