MMF-FE / svgicon

SVG icon components and tool set
https://mmf-fe.github.io/svgicon
MIT License
922 stars 95 forks source link

Default width and height | @next #92

Closed artur-laptev closed 5 years ago

artur-laptev commented 5 years ago

Hello, please add the default width and height from svg file. Now it's render without height and width attributes but in svg file i have this attributes

Allenice commented 5 years ago

The default css style has a height and width of 16px.

import 'vue-svgicon/dist/svgicon.css'

ref: https://github.com/MMF-FE/vue-svgicon/tree/dev#register-vue-svgicon-plugin

You can set default width and height use plugin options

Vue.use(VueSvgIcon, {
    tagName: 'icon',
    defaultWidth: '1em',
    defaultHeight: '1em'
})

ref: https://github.com/MMF-FE/vue-svgicon/tree/dev#defaultwidth--defaultheight

artur-laptev commented 5 years ago

i know this things, but i have in every svg width and height as attribute, so it's bad if i will set width and height in every vue component

Allenice commented 5 years ago

Use scale prop can help?

<icon scale="1" />
artur-laptev commented 5 years ago

yeap, it works! Thanks ))