mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
docs: show HTML attribute name in API prop details (#817)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
---
|
||||
import { kebabCase } from 'es-toolkit/string';
|
||||
import MarkdownCode from '@/components/typography/MarkdownCode.astro';
|
||||
import Td from '@/components/typography/Td.astro';
|
||||
import DetailRow from './DetailRow.astro';
|
||||
@@ -10,18 +11,21 @@ interface Props {
|
||||
description?: string;
|
||||
defaultValue?: string;
|
||||
required?: boolean;
|
||||
showAttributeName?: boolean;
|
||||
componentName: string;
|
||||
}
|
||||
|
||||
const { name, type, detailedType, description, defaultValue, required, componentName } = Astro.props;
|
||||
const { name, type, detailedType, description, defaultValue, required, showAttributeName, componentName } = Astro.props;
|
||||
|
||||
const id = `${componentName}-${name}`;
|
||||
const attributeName = showAttributeName ? kebabCase(name) : undefined;
|
||||
---
|
||||
|
||||
<DetailRow
|
||||
id={id}
|
||||
name={name}
|
||||
type={type}
|
||||
attributeName={attributeName}
|
||||
detailedType={detailedType}
|
||||
description={description}
|
||||
colspan={4}
|
||||
|
||||
Reference in New Issue
Block a user