diff --git a/packages/babel-plugin-jsx/README-zh_CN.md b/packages/babel-plugin-jsx/README-zh_CN.md index 07b6fce..effcf1f 100644 --- a/packages/babel-plugin-jsx/README-zh_CN.md +++ b/packages/babel-plugin-jsx/README-zh_CN.md @@ -70,39 +70,25 @@ const App = { ``` ```jsx -const App = defineComponent(() => { - const count = ref(0); +import { withModifiers, defineComponent } from 'vue'; - const inc = () => { - count.value++; - }; +const App = defineComponent({ + setup() { + const count = ref(0); - return () => ( -
- {count.value} -
- ); + const inc = () => { + count.value++; + }; + + return () => ( +
+ {count.value} +
+ ); + } }); ``` -```jsx -import { withModifiers } from 'vue'; - -const App = () => { - const count = ref(0); - - const inc = () => { - count.value++; - }; - - return () => ( -
- {count.value} -
- ); -} -``` - Fragment ```jsx @@ -204,6 +190,18 @@ const App = { }; ``` +### 在 TypesSript 中使用 + +`tsconfig.json`: + +```json +{ + "compilerOptions": { + "jsx": "preserve" + } +} +``` + ## 谁在用 diff --git a/packages/babel-plugin-jsx/README.md b/packages/babel-plugin-jsx/README.md index 1be4f8c..59f9e68 100644 --- a/packages/babel-plugin-jsx/README.md +++ b/packages/babel-plugin-jsx/README.md @@ -56,7 +56,7 @@ configuring custom elements functional component ```jsx -const App = () =>
; +const App = () =>
Vue 3.0
; ``` with render @@ -70,37 +70,23 @@ const App = { ``` ```jsx -const App = defineComponent(() => { - const count = ref(0); +import { withModifiers, defineComponent } from 'vue'; - const inc = () => { - count.value++; - }; +const App = defineComponent({ + setup() { + const count = ref(0); - return () => ( -
- {count.value} -
- ); -}); -``` + const inc = () => { + count.value++; + }; -```jsx -import { withModifiers } from 'vue'; - -const App = () => { - const count = ref(0); - - const inc = () => { - count.value++; - }; - - return () => ( -
- {count.value} -
- ); -} + return () => ( +
+ {count.value} +
+ ); + } +}) ``` Fragment @@ -204,6 +190,18 @@ const App = { }; ``` +### In TypesSript + +`tsconfig.json`: + +```json +{ + "compilerOptions": { + "jsx": "preserve" + } +} +``` + ## Who is using