Skip to content

Can't use camelCase props, breaks SVG tags with viewBox, preserveAspectRatio, etc. #62

@mgdodge

Description

@mgdodge

I have a Vue icon library that incorporates SVG icons. Since the component just wraps raw SVG tags, all valid attributes should be allowed. Updating to 1.15.0+ breaks the documentation site for the icon library. For example:

<my-vue-icon
    name="some-icon"
    :size="[140, 60]"
    preserveAspectRatio="xMidYMid slice"
/>

This would work in 1.14.x, but breaks in 1.15.0 and newer. SVG attributes are case-sensitive, so you can't just use lowercase or kebab-case versions of them.

I know there is benefit to highlighting errors, but perhaps you could make this configurable, so it can be turned off or use a case-insensitive regex when required? I would even settle for accepting a whitelist of known attributes, which could save the overhead of running the regex if it is found in the list (I know, micro-optimization...)

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