@@ -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
307307Create 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
310312There 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
314316function App () {
315317 return (
316- < fragment >
318+ <>
317319 < h1> Mettle< / h1>
318320 < h2> Hello! < / h2>
319- < / fragment >
321+ < / >
320322 );
321323}
322324```
0 commit comments