This commit is contained in:
yanmao 2022-01-04 23:09:39 +08:00
parent 64830cf947
commit c67f1bc250
2 changed files with 16 additions and 16 deletions

View File

@ -63,26 +63,26 @@ So its value looks like this:
Of course, in some scenarios, for the convenience of operation, an API that converts to a JSON type value is also provided:
```json
```ts
[
"div", // node name
'div', // node name
// All attributes of the node
{
"data-element": "root",
"contenteditable": "true"
'data-element': 'root',
contenteditable: 'true',
},
// child node 1
[
// child node name
"p",
'p',
// Child node attributes
{},
// child node of byte point
"Hello world!"
'Hello world!',
],
// child node 2
["p", {}, ["br", {}]]
]
['p', {}, ['br', {}]],
];
```
<Alert>

View File

@ -63,26 +63,26 @@
当然,有些场景下为了方便操作,也提供了转换为 JSON 类型值的 API
```json
```ts
[
"div", // 节点名称
'div', // 节点名称
// 节点所有的属性
{
"data-element": "root",
"contenteditable": "true"
'data-element': 'root',
contenteditable: 'true',
},
// 子节点1
[
// 子节点名称
"p",
'p',
// 子节点属性
{},
// 字节点的子节点
"Hello world!"
'Hello world!',
],
// 子节点2
["p", {}, ["br", {}]]
]
['p', {}, ['br', {}]],
];
```
<Alert>