Skip to content

Is there a way to specify a Vue component inside of the columns declaration? #38

@ajmcgrail

Description

@ajmcgrail

Hi there. Big fan of the change that now allows you to use Vue components in named slots, but I had a question/feature request (not sure if it's already implemented). Is there a way to specify a Vue component that will be used WITHOUT using a named slot?

For example, let's say that I want to have a list of button columns that I may or may not want to render, or I want to change the order on them. The point is that using a named slot wouldn't easily allow that. Is there a way to instead pass the Vue component directly in the defined columns of the DataTable component props?

I imagine it would look something like this:

// MyVueComponent is the just the imported vue component
const things: ConfigColumns[] = [{ data: null, render: MyVueComponent, additionalProps: {testProp: 5} }];

But as far as I can tell this isn't supported? I took at look at the DataTable Vue component source code and I think it looks feasible to implement with the existing logic of how Vue components are rendered, along with passing additional props. I might be able to try what I want in a PR if that would be preferred.

Please let me know if I need to give any more information. Thanks for your time!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions