Skip to content

Commit

Permalink
fix error at prepareBySpecializedClassNameList
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Shevchik committed Oct 15, 2024
1 parent e2a1892 commit 369f31e
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions docs/.vitepress/theme/components/icons/CopyButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,34 +50,34 @@ function prepareBySpecializedClassNameList(): string[]
{
const className = []
if(props.icon.specialized.animateSpin)
if(props.icon?.specialized?.animateSpin)
{
className.push('animate-spin-slow')
}
if(props.icon.specialized.animateSpinNormal)
if(props.icon?.specialized?.animateSpinNormal)
{
className.push('animate-spin')
}
if(props.icon.specialized.stroke === 'stroke-bold')
if(props.icon?.specialized?.stroke === 'stroke-bold')
{
className.push('stroke-[6px]')
}
else if(props.icon.specialized.stroke === 'stroke-normal')
else if(props.icon?.specialized?.stroke === 'stroke-normal')
{
className.push('stroke-2')
}
else if(props.icon.specialized.stroke === 'stroke-thin')
else if(props.icon?.specialized?.stroke === 'stroke-thin')
{
className.push('stroke-1')
}
if(props.icon.specialized.width === 'w-lg')
if(props.icon?.specialized?.width === 'w-lg')
{
className.push('w-lg')
}
else if(props.icon.specialized.width === 'w-[21px]')
else if(props.icon?.specialized?.width === 'w-[21px]')
{
className.push('w-[21px]')
}
Expand All @@ -86,11 +86,11 @@ function prepareBySpecializedClassNameList(): string[]
className.push('w-3')
}
if(props.icon.specialized.height === 'h-lg')
if(props.icon?.specialized?.height === 'h-lg')
{
className.push('h-lg')
}
else if(props.icon.specialized.height === 'h-[21px]')
else if(props.icon?.specialized?.height === 'h-[21px]')
{
className.push('h-[21px]')
}
Expand All @@ -112,10 +112,10 @@ function copyVue()
``,
`<#icon#${attrs.join(' ')} />`
].join("\n")
.replace('#icon#', props.icon.icon)
.replace('#icon#', props.icon.icon)
.replace('#icon#', props.icon.icon)
.replace('#type#', props.icon.type)
.replace('#icon#', props.icon.icon)
.replace('#icon#', props.icon.icon)
.replace('#icon#', props.icon.icon)
.replace('#type#', props.icon.type)
navigator.clipboard.writeText(code)
Expand Down

0 comments on commit 369f31e

Please sign in to comment.