Open shrpne opened 6 years ago
Hi shrpne, yes it totally makes sense. I'll be working on this this weekend, or you can give me a pull request. Thanks!
Hi, Please note that setting the fill and stroke props to none doesn't work as described, it's not drawing black but its still discarding the original fill and stroke styles in the svg itself.
The expected behavior is that when we don't provide these props or when we give them the value "none" the original stroke and fill styles in the SVG should be kept as is.
Nice plugin BTW and this issue must be fixed to make it perfect.
'none'
is a valid option for fill
and should not be treated as undefined.
I think to keep original style we should pass values like undefined
or false
.
Also, you can check vue-inline-svg it works with attributes as expected.
Thank you for your great plugin, but I have some concerns with the current way of setting SVG attributes:
<simple-svg>
, but often SVG in the file already have fine styled attributesopacity
,stroke-width
,stroke-linecap
,stroke-dasharray
and many more https://developer.mozilla.org/ru/docs/Web/SVG/AttributeMy suggestion to resolve these issues:
width: '400px'
, width will be overridden. If I specifyfill: 'none'
, fill will be set to 'none'. If I specify'stroke-width': ''
, stroke-width will be removed.Also, it will fix #4