Skip to content

tag agnostic transformToRequire #978

Closed
@FranckFreiburger

Description

@FranckFreiburger

What problem does this feature solve?

I have several components that accepts an image url as property.
To handle this, I have two options:

  • use explicit require <mycomponent :imgsrc="require('./Freepik-awesomecontent.jpg')">.
  • add imgsrc attribute to transformToRequire for each component I use

It could be convenient to make the tagname optional and specify only an attribute in transformToRequire

What does the proposed API look like?

I propose a empty string for optional tag
transformToRequire: { '':'imgsrc' }

or

a function that tells vue-loader that the attribute has to be transformed into require
transformToRequire: function(tagName, attributeName) { ...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions