Skip to content

Commit 70e3794

Browse files
committed
docs: add compositionAPI option example
1 parent 816c93f commit 70e3794

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

packages/babel-preset-jsx/README.md

+15-13
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,33 @@ yarn add @vue/babel-preset-jsx @vue/babel-helper-vue-jsx-merge-props
1717
npm install @vue/babel-preset-jsx @vue/babel-helper-vue-jsx-merge-props --save
1818
```
1919

20-
In your `.babelrc`:
20+
In your `babel.config.js`:
2121

22-
```json
23-
{
24-
"presets": ["@vue/babel-preset-jsx"]
22+
```js
23+
module.exports = {
24+
presets: ['@vue/babel-preset-jsx'],
2525
}
2626
```
2727

28-
You can toggle specific features, by default all features are enabled, e.g.:
28+
You can toggle specific features, by default all features (except `compositionAPI`) are enabled, e.g.:
2929

30-
```json
31-
{
32-
"presets": [
30+
```js
31+
module.exports = {
32+
presets: [
3333
[
34-
"@vue/babel-preset-jsx",
34+
'@vue/babel-preset-jsx',
3535
{
36-
"vModel": false
37-
}
38-
]
39-
]
36+
vModel: false,
37+
compositionAPI: true,
38+
},
39+
],
40+
],
4041
}
4142
```
4243

4344
Options are:
4445

46+
- `compositionAPI` - Enables [@vue/babel-sugar-composition-api-inject-h](../babel-sugar-composition-api-inject-h) and [@vue/babel-sugar-composition-api-render-instance](../babel-sugar-composition-api-inject-h), support returning render function in `setup`.
4547
- `functional` [@vue/babel-sugar-functional-vue](../babel-sugar-functional-vue/README.md) - Functional components syntactic sugar
4648
- `injectH` [@vue/babel-sugar-inject-h](../babel-sugar-inject-h/README.md) - Automatic `h` injection syntactic sugar
4749
- `vModel` [@vue/babel-sugar-v-model](../babel-sugar-v-model/README.md) - `vModel` syntactic sugar

0 commit comments

Comments
 (0)