Skip to content

Commit 6ea5b2a

Browse files
committed
init
1 parent 93ca251 commit 6ea5b2a

File tree

6 files changed

+80
-76
lines changed

6 files changed

+80
-76
lines changed

doc/en/essentials/api/index.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ function App() {
2727
}
2828

2929
return (
30-
<fragment>
30+
<>
3131
<button onClick={add}>add</button>
3232
<p>{count}</p>
33-
</fragment>
33+
</>
3434
);
3535
}
3636
```
@@ -49,11 +49,11 @@ function App() {
4949
}
5050

5151
return (
52-
<fragment>
52+
<>
5353
<button onClick={add}>add</button>
5454
<p>{count}</p>
5555
<p>{double}</p>
56-
</fragment>
56+
</>
5757
);
5858
}
5959
```
@@ -73,10 +73,10 @@ function App() {
7373
}
7474

7575
return (
76-
<fragment>
76+
<>
7777
<button onClick={change}>change</button>
7878
<p>{name}</p>
79-
</fragment>
79+
</>
8080
);
8181
}
8282
```
@@ -98,11 +98,11 @@ function App() {
9898
}
9999

100100
return (
101-
<fragment>
101+
<>
102102
<button onClick={change}>change</button>
103103
<p>{name}</p>
104104
<p>{surname}</p>
105-
</fragment>
105+
</>
106106
);
107107
}
108108
```
@@ -127,11 +127,11 @@ function App() {
127127
}
128128

129129
return (
130-
<fragment>
130+
<>
131131
<button onClick={change}>change</button>
132132
<p>{name}</p>
133133
<p>{surname}</p>
134-
</fragment>
134+
</>
135135
);
136136
}
137137
```
@@ -151,14 +151,14 @@ function handleArr() {
151151
}
152152

153153
return (
154-
<fragment>
154+
<>
155155
<button onClick={push}>push</button>
156156
<ul>
157157
{arr.value.map((item) => (
158158
<li key={item}>{item}</li>
159159
))}
160160
</ul>
161-
</fragment>
161+
</>
162162
);
163163
}
164164
```
@@ -176,10 +176,10 @@ function handleObj() {
176176
}
177177

178178
return (
179-
<fragment>
179+
<>
180180
<button onClick={change}>change</button>
181181
<p>{obj.value.name}</p>
182-
</fragment>
182+
</>
183183
);
184184
}
185185
```

doc/en/essentials/usage/index.md

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ function App() {
3939
const showHtm = computed(() => (isShow.value ? <p>Mettle.js</p> : <null></null>));
4040

4141
return (
42-
<fragment>
42+
<>
4343
<button onClick={useShow}>show</button>
4444
<div>{showHtm}</div>
45-
</fragment>
45+
</>
4646
);
4747
}
4848
```
@@ -62,14 +62,14 @@ function handleArr() {
6262
}
6363

6464
return (
65-
<fragment>
65+
<>
6666
<button onClick={push}>push</button>
6767
<ul>
6868
{arr.value.map((item) => (
6969
<li key={item}>{item}</li>
7070
))}
7171
</ul>
72-
</fragment>
72+
</>
7373
);
7474
}
7575
```
@@ -103,10 +103,10 @@ function MyComponent() {
103103
}
104104

105105
return (
106-
<fragment>
106+
<>
107107
<p>{count}</p>
108108
<button onClick={add}>MyComponent</button>
109-
</fragment>
109+
</>
110110
);
111111
}
112112

@@ -118,11 +118,11 @@ function App() {
118118
}
119119

120120
return (
121-
<fragment>
121+
<>
122122
<p>{count}</p>
123123
<button onClick={add}>App</button>
124124
<MyComponent />
125-
</fragment>
125+
</>
126126
);
127127
}
128128
```
@@ -140,10 +140,10 @@ function Child({ content }) {
140140
};
141141

142142
return (
143-
<fragment>
143+
<>
144144
<button onClick={post}>Post</button>
145145
<Child />
146-
</fragment>
146+
</>
147147
);
148148
}
149149

@@ -153,10 +153,10 @@ function App() {
153153
}
154154

155155
return (
156-
<fragment>
156+
<>
157157
<button onClick={get}>Get</button>
158158
<Child />
159-
</fragment>
159+
</>
160160
);
161161
}
162162
```
@@ -194,11 +194,11 @@ function App() {
194194
}
195195

196196
return (
197-
<fragment>
197+
<>
198198
<h1 $ref={h1} onClick={getDomInfo}>
199199
Hello
200200
</h1>
201-
</fragment>
201+
</>
202202
);
203203
}
204204
```
@@ -216,11 +216,11 @@ function App() {
216216
}
217217

218218
return (
219-
<fragment>
219+
<>
220220
<button onClick={add}>Add</button>
221221
<h1 $once>{count}</h1>
222222
<h2>{count}</h2>
223-
</fragment>
223+
</>
224224
);
225225
}
226226
```
@@ -259,7 +259,7 @@ function App({ memo }) {
259259
}
260260

261261
return (
262-
<fragment>
262+
<>
263263
<ul onClick={handle}>
264264
{arr.value.map((todo) => (
265265
<li
@@ -272,7 +272,7 @@ function App({ memo }) {
272272
</li>
273273
))}
274274
</ul>
275-
</fragment>
275+
</>
276276
);
277277
}
278278
```
@@ -294,10 +294,10 @@ function App() {
294294
}
295295

296296
return (
297-
<fragment>
297+
<>
298298
<button onClick={useShow}>show</button>
299299
<div>{isShow.value ? <p>Mettle.js</p> : <null></null>}</div>
300-
</fragment>
300+
</>
301301
);
302302
}
303303
```
@@ -306,17 +306,19 @@ function App() {
306306

307307
Create a document fragment tag. It is not part of the real DOM tree, its changes will not trigger a re-rendering of the DOM tree, and will not have an impact on performance.
308308

309+
Typically `<>...</>` is used instead.
310+
309311
::: warning
310312
There is only one root component, so you will see it used as the root component in many places in the documentation.
311313
:::
312314

313315
```jsx
314316
function App() {
315317
return (
316-
<fragment>
318+
<>
317319
<h1>Mettle</h1>
318320
<h2>Hello!</h2>
319-
</fragment>
321+
</>
320322
);
321323
}
322324
```

doc/en/tool/mettleRouter/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ function About() {
7878
}
7979

8080
return (
81-
<fragment>
81+
<>
8282
<button onClick={goHome}>goHome</button>
8383
<h1 onClick={getOption}>About</h1>
84-
</fragment>
84+
</>
8585
);
8686
}
8787
```

doc/zh/essentials/api/index.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ function App() {
2727
}
2828

2929
return (
30-
<fragment>
30+
<>
3131
<button onClick={add}>add</button>
3232
<p>{count}</p>
33-
</fragment>
33+
</>
3434
);
3535
}
3636
```
@@ -49,11 +49,11 @@ function App() {
4949
}
5050

5151
return (
52-
<fragment>
52+
<>
5353
<button onClick={add}>add</button>
5454
<p>{count}</p>
5555
<p>{double}</p>
56-
</fragment>
56+
</>
5757
);
5858
}
5959
```
@@ -73,10 +73,10 @@ function App() {
7373
}
7474

7575
return (
76-
<fragment>
76+
<>
7777
<button onClick={change}>change</button>
7878
<p>{name}</p>
79-
</fragment>
79+
</>
8080
);
8181
}
8282
```
@@ -98,11 +98,11 @@ function App() {
9898
}
9999

100100
return (
101-
<fragment>
101+
<>
102102
<button onClick={change}>change</button>
103103
<p>{name}</p>
104104
<p>{surname}</p>
105-
</fragment>
105+
</>
106106
);
107107
}
108108
```
@@ -127,11 +127,11 @@ function App() {
127127
}
128128

129129
return (
130-
<fragment>
130+
<>
131131
<button onClick={change}>change</button>
132132
<p>{name}</p>
133133
<p>{surname}</p>
134-
</fragment>
134+
</>
135135
);
136136
}
137137
```
@@ -151,14 +151,14 @@ function handleArr() {
151151
}
152152

153153
return (
154-
<fragment>
154+
<>
155155
<button onClick={push}>push</button>
156156
<ul>
157157
{arr.value.map((item) => (
158158
<li key={item}>{item}</li>
159159
))}
160160
</ul>
161-
</fragment>
161+
</>
162162
);
163163
}
164164
```
@@ -176,10 +176,10 @@ function handleObj() {
176176
}
177177

178178
return (
179-
<fragment>
179+
<>
180180
<button onClick={change}>change</button>
181181
<p>{obj.value.name}</p>
182-
</fragment>
182+
</>
183183
);
184184
}
185185
```

0 commit comments

Comments
 (0)