Create an icon component function, like so:
// Pass in the icon name
module.exports = function icon (name) {
const style = {
width: '24px',
height: '24px',
stroke: 'currentColor',
strokeWidth: 2,
strokeLinecap: 'round',
strokeLinejoin: 'round',
fill: 'none'
}
return h('svg', {
style,
hook: {
insert: (vnode) => {
vnode.elm.innerHTML = feather.icons[name].toString()
}
}
})
}
Use the insert
hook to render the contents of the SVG.