Types
JsxChild
表示 JSX 内容中单个元素的联合类型
概述
JsxChild 表示 JSX 内容中的单个子元素。
type JsxChild = string | JsxElement | Variable;联合成员
| 类型 | 描述 | 
|---|---|
| string | 纯文本内容 | 
| JsxElement | 结构化元素 | 
| Variable | 动态占位符 | 
示例
基本类型
import { JsxChild, Variable } from 'generaltranslation';
// 字符串
const text: JsxChild = "欢迎!";
// 变量
const name: JsxChild = { k: 'userName' } as Variable;
// 元素
const link: JsxChild = {
  t: 'a',
  c: ['点击这里']
};相关类型
- JsxChildren- 由多个 JsxChild 组成的集合
- JsxElement- 结构化的元素
这份指南怎么样?

