# generaltranslation: General Translation Core SDK: JsxChild URL: https://generaltranslation.com/zh/docs/core/types/jsx-child.mdx --- title: JsxChild description: 表示 JSX 内容中单个元素的联合类型 --- ## 概述 `JsxChild` 表示 JSX 内容中的单个元素。 ```typescript type JsxChild = string | JsxElement | Variable; ``` ## 联合类型成员 | 类型 | 描述 | | ------------ | ----- | | `string` | 纯文本内容 | | `JsxElement` | 结构化元素 | | `Variable` | 动态占位符 | ## 示例 ### 基本类型 ```typescript copy import { JsxChild, Variable } from 'generaltranslation'; // 字符串 const text: JsxChild = "Welcome!"; // 变量 const name: JsxChild = { k: 'userName' } as Variable; // 元素 const link: JsxChild = { t: 'a', c: ['Click here'] }; ``` ## 相关类型 * [`JsxChildren`](/docs/core/types/jsx-children) - 由多个 `JsxChild` 元素组成的集合 * [`JsxElement`](/docs/core/types/jsx-element) - 结构化元素