Skip to content

Feature Request: Pass attributes back from each section on call to parseComponent #4914

@zephraph

Description

@zephraph

When an external tool is using vue-template-compiler it would be very useful to have access to any attributes that are set on the template, script, or style sections. Custom blocks already do this, but the previously mentioned three don't.

This specifically applies to the parseComponent method.

In my use case I'm building a webpack loader to separate out component themes into a separate file.

Calling parseComponent on a file that contained the following...

<style theme="site" lang="stylus">

This would allow me to do processComponent(src).output.styles[0].attrs.theme in my tool. Without doing this I'm forced to do the parsing myself which seems unnecessary.

I would use custom blocks for this, but custom blocks don't have syntax highlighting in any editor that supports *.vue files.

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