Skip to content

Commit

Permalink
feat: added viewBox prop to module
Browse files Browse the repository at this point in the history
  • Loading branch information
Armin Ayari committed Apr 30, 2019
1 parent f6e8a26 commit 7706e38
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ const SvgIcon = {
desc: {
type: String,
default: null
},
viewBox: {
type: String,
default: null,
validator (value) {
return value.split(' ').every((v) => {
return !isNaN(parseInt(v))
})
}
}
},
computed: {
Expand Down Expand Up @@ -50,7 +59,8 @@ const SvgIcon = {
const desc = this.desc ? h('desc', this.desc) : null
return h('svg', {
attrs: {
xmlns: 'http://www.w3.org/2000/svg'
xmlns: 'http://www.w3.org/2000/svg',
viewBox: this.viewBox
}
},
[ title, desc, use ].filter(Boolean)
Expand Down

0 comments on commit 7706e38

Please sign in to comment.