From 881ea9ec843fe94765296428c45eab3a6e04c203 Mon Sep 17 00:00:00 2001 From: Amour1688 Date: Wed, 29 Jul 2020 12:37:37 +0800 Subject: [PATCH] docs: upgrade README --- packages/babel-plugin-jsx/README-zh_CN.md | 22 ++++++++++++++++++---- packages/babel-plugin-jsx/README.md | 23 +++++++++++++++++++---- 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/packages/babel-plugin-jsx/README-zh_CN.md b/packages/babel-plugin-jsx/README-zh_CN.md index 5a2d28f..5b6337b 100644 --- a/packages/babel-plugin-jsx/README-zh_CN.md +++ b/packages/babel-plugin-jsx/README-zh_CN.md @@ -26,15 +26,29 @@ npm install @ant-design-vue/babel-plugin-jsx -D ### 参数 -* transformOn +#### transformOn + +Type: `boolean` + +Default: `false` 把 `on: { click: xx }` 转成 `onClick: xxx` -* compatibleProps +#### optimize -兼容大多数 Vue 2 的写法,Vue 3 中,把所有属性都改成了顶级属性,意味这不需要再传递 props,attrs 这些属性。 +Type: `boolean` -开启这个参数意味着对 { attrs, props, on } 做了兼容处理,但是所有的属性外层都会有 `compatibleProps` 方法 +Default: `false` + +是否开启优化. 如果你对 Vue 3 不太熟悉,不建议打开 + +#### isCustomElement + +Type: `(tag: string) => boolean` + +Default: `undefined` + +自定义元素 ## 表达式 diff --git a/packages/babel-plugin-jsx/README.md b/packages/babel-plugin-jsx/README.md index 15e1cec..333deb5 100644 --- a/packages/babel-plugin-jsx/README.md +++ b/packages/babel-plugin-jsx/README.md @@ -26,14 +26,29 @@ Then add the plugin to .babelrc: ### options -* transformOn +#### transformOn + +Type: `boolean` + +Default: `false` transform `on: { click: xx }` to `onClick: xxx` -* compatibleProps -compatible with Vue 2.x +#### optimize -`{ props, on = {}, attrs, ...rest }` will be transformed to `{ ...props, ...attrs, ...transformOn(on), ...rest }` +Type: `boolean` + +Default: `false` + +enable optimization or not. It's not recommended to enable it If you are not familiar with Vue 3. + +#### isCustomElement + +Type: `(tag: string) => boolean` + +Default: `undefined` + +configuring custom elements ## Syntax