You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To make JSX/TSX work with `@vue/composition-api`, check out [babel-preset-vca-jsx](https://github.com/luwanquan/babel-preset-vca-jsx) by [@luwanquan](https://github.com/luwanquan).
71
71
72
+
73
+
74
+
## SSR
75
+
76
+
Even if there is no definitive Vue 3 API for SSR yet, this plugin implements the `onServerPrefetch` lifecycle hook that allows you to use the `serverPrefetch` hook found in the classic API.
⚠️ <code>reactive()</code> <b>mutates</b> the original object
355
+
</summary>
356
+
357
+
`reactive` uses `Vue.observable` underneath which will ***mutate*** the original object.
358
+
359
+
> :bulb: In Vue 3, it will return an new proxy object.
360
+
361
+
362
+
</details>
363
+
364
+
### Watch
365
+
366
+
<details>
367
+
<summary>
368
+
❌ <code>onTrack</code> and <code>onTrigger</code> are not available in <code>WatchOptions</code>
369
+
</summary>
370
+
371
+
```js
372
+
watch(() => {
373
+
/* ... */
374
+
}, {
375
+
immediate:true,
376
+
onTrack() {}, // not available
377
+
onTrigger() {}, // not available
378
+
})
379
+
```
380
+
381
+
</details>
382
+
383
+
### Missing APIs
384
+
385
+
The following APIs introduced in Vue 3 are not available in this plugin.
296
386
297
-
### :x: Reactive APIs in `data()`
387
+
-`readonly`
388
+
-`shallowReadonly`
389
+
-`defineAsyncComponent`
390
+
-`onRenderTracked`
391
+
-`onRenderTriggered`
392
+
-`customRef`
393
+
-`isProxy`
394
+
-`isReadonly`
395
+
-`isVNode`
298
396
299
-
Passing `ref`, `reactive` or other reactive apis to `data()` would not work.
397
+
### Reactive APIs in `data()`
398
+
399
+
<details>
400
+
<summary>
401
+
❌ Passing <code>ref</code>, <code>reactive</code> or other reactive apis to <code>data()</code> would not work.
402
+
</summary>
300
403
301
404
```jsx
302
405
exportdefault {
@@ -306,27 +409,15 @@ export default {
306
409
a:ref(1)
307
410
}
308
411
},
309
-
};
412
+
}
310
413
```
311
414
312
-
## SSR
415
+
</details>
313
416
314
-
Even if there is no definitive Vue 3 API for SSR yet, this plugin implements the `onServerPrefetch` lifecycle hook that allows you to use the `serverPrefetch` hook found in the classic API.
Due the the limitation of Vue2's public API. `@vue/composition-api` inevitably introduced some extract costs. It shouldn't bother you unless in extreme environments.
322
421
323
-
onServerPrefetch(async () => {
324
-
result.value=awaitcallApi(ssrContext.someId)
325
-
})
422
+
You can check the [benchmark results](https://antfu.github.io/vue-composition-api-benchmark-results/) for more details.
0 commit comments