Non-prop attributes are not being inherited
See original GitHub issueWhen transforming an svg to a component and trying to add an attribute, like `data-testid, and it’s not being rendered
Example:
<template>
<div id="app">
<Icon style="flex: 1" class="icon" data-testid="asfg"/>
</div>
</template>
<script setup>
import Icon from './icons/icon.svg';
</script>
Render as:
<div id="app">
<svg class="icon" viewBox="0 0 360 264" fill="none" xmlns="http://www.w3.org/2000/svg" style="flex: 1 1 0%;">
...
</svg>
</div>
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Vue JS Non prop attributes and Disabling Attribute Inheritance
If you put a random html attribute onto the component, it will appear on the rendered component. If you disable inheritance, it won't....
Read more >Non-Prop Attributes - Vue.js
Attribute Inheritance. When a component returns a single root node, non-prop attributes will automatically be added to the root node's ...
Read more >Fallthrough Attributes - Vue.js
Attribute Inheritance #. A "fallthrough attribute" is an attribute or v-on event listener that is passed to a component, but is not explicitly...
Read more >31. Non Prop Attributes and Attribute Inheritance. Disable ...
Hi FriendsIn this video, we will see the non-prop attributes and how to access them using $attrs variable in child component.
Read more >Inheritance Within the Object Type Hierarchy - Salesforce Help
Vlocity object types are designed with an inheritance type architecture where ... You should not delete the inherited attributes and fields from the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I also need the attributes to remain intact. Otherwise i cannot use this
Looks like related: https://github.com/jpkleemans/vite-svg-loader/issues/31