Closed fisschl closed 3 months ago
If I don't pass stroke-width on the Vue component, in the createVueComponent function, the stroke-width option will be overwritten as undefined.
stroke-width
createVueComponent
undefined
This causes the stroke-width option set in defaultAttributes.ts to not take effect.
defaultAttributes.ts
import { h } from 'vue'; import defaultAttributes from './defaultAttributes'; import type { Icon, IconNode, IconProps } from './types'; const createVueComponent = ( type: 'outline' | 'filled', iconName: string, iconNamePascal: string, iconNode: IconNode, ): Icon => ({ size, color = 'currentColor', class: classes, stroke, ...rest }: IconProps, { attrs, slots }) => { return h( 'svg', { ...defaultAttributes[type], width: size, height: size, ...attrs, class: ['tabler-icon', `tabler-icon-${iconName}`], ...(type === 'filled' ? { fill: color, } : { 'stroke-width': stroke, stroke: color, }), ...rest, }, [...iconNode.map((child) => h(...child)), ...(slots.default ? [slots.default()] : [])], ); }; export default createVueComponent;
Still actual in v3.5 This issue blocks for us upgrade from v2.
Also actual for size prop (should be 24 by default).
size
If I don't pass
stroke-width
on the Vue component, in thecreateVueComponent
function, thestroke-width
option will be overwritten asundefined
.This causes the
stroke-width
option set indefaultAttributes.ts
to not take effect.