chore: tweak
This commit is contained in:
parent
b85a9e7a01
commit
1e779a7b86
@ -18,15 +18,13 @@ export const codeTabs: PluginSimple = (md) => {
|
||||
|
||||
const titlesContent = titles.map((title, index) => {
|
||||
const icon = getFileIconName(title)
|
||||
return `\<template #title${index}="{ value, isActive }">${icon ? `<VPIcon name="${icon}"/>` : ''}<span>${title}</span></template>`
|
||||
return `<template #title${index}="{ value, isActive }">${icon ? `<VPIcon name="${icon}"/>` : ''}<span>${title}</span></template>`
|
||||
}).join('')
|
||||
|
||||
return `<CodeTabs id="${index}" :data='${stringifyProp(tabsData)}'${active === -1 ? '' : ` :active="${active}"`}${meta.id ? ` tab-id="${meta.id as string}"` : ''}>${titlesContent}`
|
||||
},
|
||||
|
||||
tabsCloseRenderer: () => `\
|
||||
</CodeTabs>
|
||||
`,
|
||||
tabsCloseRenderer: () => `</CodeTabs>`,
|
||||
|
||||
tabOpenRenderer: ({ index }, tokens, tokenIndex) => {
|
||||
let foundFence = false
|
||||
@ -49,13 +47,9 @@ export const codeTabs: PluginSimple = (md) => {
|
||||
}
|
||||
}
|
||||
|
||||
return `\
|
||||
<template #tab${index}="{ value, isActive }">
|
||||
`
|
||||
return `<template #tab${index}="{ value, isActive }">`
|
||||
},
|
||||
|
||||
tabCloseRenderer: () => `\
|
||||
</template>
|
||||
`,
|
||||
tabCloseRenderer: () => `</template>`,
|
||||
})
|
||||
}
|
||||
|
||||
@ -15,33 +15,17 @@ export const tabs: PluginSimple = (md) => {
|
||||
return { id }
|
||||
})
|
||||
|
||||
return `\
|
||||
<Tabs id="${index}" :data='${stringifyProp(tabsData)}'${
|
||||
active === -1 ? '' : ` :active="${active}"`
|
||||
}${
|
||||
meta.id ? ` tab-id="${meta.id as string}"` : ''
|
||||
}>
|
||||
${titles
|
||||
.map(
|
||||
(title, titleIndex) => `\
|
||||
<template #title${titleIndex}="{ value, isActive }">${title}</template>
|
||||
`,
|
||||
)
|
||||
.join('')}\
|
||||
`
|
||||
return `<Tabs id="${index}" :data='${stringifyProp(tabsData)}'${active === -1 ? '' : ` :active="${active}"`}${meta.id ? ` tab-id="${meta.id as string}"` : ''}>
|
||||
${titles.map((title, titleIndex) =>
|
||||
`<template #title${titleIndex}="{ value, isActive }">${title}</template>`,
|
||||
).join('')}`
|
||||
},
|
||||
|
||||
tabsCloseRenderer: () => `\
|
||||
</Tabs>
|
||||
`,
|
||||
tabsCloseRenderer: () => `</Tabs>`,
|
||||
|
||||
tabOpenRenderer: ({ index }) =>
|
||||
`\
|
||||
<template #tab${index}="{ value, isActive }">
|
||||
`,
|
||||
`<template #tab${index}="{ value, isActive }">`,
|
||||
|
||||
tabCloseRenderer: () => `\
|
||||
</template>
|
||||
`,
|
||||
tabCloseRenderer: () => `</template>`,
|
||||
})
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user