Skip to content

Unable to pass directive through functional component template #9239

@brophdawg11

Description

@brophdawg11

Version

2.5.17

Reproduction link

https://codesandbox.io/s/nrpjvl3v0

Steps to reproduce

If you look at the linked code sandbox, there is a simple directive being used on a normal component, a functional component using a render function, and a functional component using a template. I could not find a way to get the directive passed through in the functional template example. Essentially a similar approach to v-bind="attrs" and v-on='listeners" but for directives.

Is this currently possible? If not, would it be considered? Otherwise - in order to write functional template components, you would need to ensure they are never intended to be used with custom directives.

Our specific use case was that we have a base button component that is a functional template components, but it doesn't work with https://www.npmjs.com/package/vue2-touch-events

What is expected?

A method through the functional template to proxy through directives.

What is actually happening?

The custom directive cannot be applied to the functional template component.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions