Types
JsxElement
可翻译 JSX 内容中类 HTML 结构化元素的类型定义
概述
JsxElement 表示在可翻译的 JSX 内容中具有结构化的类 HTML 元素。
type JsxElement = {
  t?: string;      // 标签名
  i?: number;      // id
  d?: GTProp;      // GT 数据/属性
  c?: JsxChildren; // 子内容
};属性
| 属性 | 类型 | 说明 | 
|---|---|---|
| t? | string | HTML 标签名 | 
| i? | number | 内部标识 | 
| d? | GTProp | GT 属性 | 
| c? | JsxChildren | 子级内容 | 
常用 GT 键名
| GT 键名 | HTML 属性 | 
|---|---|
| pl | placeholder | 
| ti | title | 
| alt | alt | 
| arl | aria-label | 
示例
基本用法
import { JsxElement, Variable } from 'generaltranslation';
// 简单元素
const heading: JsxElement = {
  t: 'h1',
  c: ['欢迎']
};
// 带属性
const button: JsxElement = {
  t: 'button',
  d: { ti: '提交表单' },
  c: ['提交']
};相关类型
- JsxChildren- children 内容类型
- JsxChild- 单个子节点
这份指南怎么样?

