/
githubmirror
/
bootstrap
Обзор
Документация
Войти
/
githubmirror
/
bootstrap
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
site/src/components/shortcodes/Table.astro
32 строки
913 B
Julien Déramond
Docs: use `Example` shortcode instead of divs with only `.bd-example` class (#41556)
19 июн 2025, 19:56
Не верифицирован
19 июн 2025, 19:56
b851a99
Код
Авторство
О чём код?
--- import Code from '@shortcodes/Code.astro' import Example from '@shortcodes/Example.astro' import * as tableContent from '@shortcodes/TableContent.md' interface Props { /** * Any class(es) to be added to the `<table>` element (both in the example and code snippet). */ class?: string /** * Show a simplified version in the example code snippet by replacing the table content inside `<table>` & `</table>` * with `...`. * @default true */ simplified?: boolean } const { class: className, simplified = true } = Astro.props const tableCode = `<table${className ? ` class="${className}"` : ''}> ${simplified ? ' ...' : await tableContent.compiledContent()} </table>` const exampleCode = `<table${className ? ` class="${className}"` : ''}> ${await tableContent.compiledContent()} </table>` --- <Example showMarkup={false} code={exampleCode} /> <Code code={tableCode} lang="html" />