chore: 动态类名(无效)改为style
This commit is contained in:
parent
51c29fcc9c
commit
a60ff01c3a
@ -52,7 +52,10 @@ function renderTag(text: string, color?: string) {
|
|||||||
*/
|
*/
|
||||||
export function renderTags(tags: string[], wrap = false, gap = 1) {
|
export function renderTags(tags: string[], wrap = false, gap = 1) {
|
||||||
return (
|
return (
|
||||||
<div class={['flex', `gap-${gap}`, wrap ? 'flex-col' : 'flex-row']}>
|
<div
|
||||||
|
class={['flex', wrap ? 'flex-col' : 'flex-row']}
|
||||||
|
style={{ gap: `${gap}px` }}
|
||||||
|
>
|
||||||
{tags.map((tag, index) => {
|
{tags.map((tag, index) => {
|
||||||
return <div key={index}>{renderTag(tag)}</div>;
|
return <div key={index}>{renderTag(tag)}</div>;
|
||||||
})}
|
})}
|
||||||
@ -135,7 +138,10 @@ export function renderDictTags(
|
|||||||
return <div>{value}</div>;
|
return <div>{value}</div>;
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div class={['flex', `gap-${gap}`, wrap ? 'flex-col' : 'flex-row']}>
|
<div
|
||||||
|
class={['flex', wrap ? 'flex-col' : 'flex-row']}
|
||||||
|
style={{ gap: `${gap}px` }}
|
||||||
|
>
|
||||||
{value.map((item, index) => {
|
{value.map((item, index) => {
|
||||||
return <div key={index}>{renderDictTag(item, dicts)}</div>;
|
return <div key={index}>{renderDictTag(item, dicts)}</div>;
|
||||||
})}
|
})}
|
||||||
|
Loading…
Reference in New Issue
Block a user