From f8f6db730d478f2804c897992f79f7b92a27cac1 Mon Sep 17 00:00:00 2001 From: sunnie <406803045@qq.com> Date: Tue, 21 Apr 2020 12:15:41 +0800 Subject: [PATCH] readme --- README.md | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 456f0d6..2b65aa9 100644 --- a/README.md +++ b/README.md @@ -222,24 +222,31 @@ module.exports = { #### 安装插件 -```javascript +```bash npm i babel-plugin-import -D +``` + +在` babel.config.js` 设置 + +```javascript // 对于使用 babel7 的用户,可以在 babel.config.js 中配置 -module.exports = { - presets: [['@vue/cli-plugin-babel/preset', {useBuiltIns: 'entry'}]], - plugins: [ - [ - 'import', - { - libraryName: 'vant', - libraryDirectory: 'es', - style: true - }, - 'vant' - ] +const plugins = [ + [ + 'import', + { + libraryName: 'vant', + libraryDirectory: 'es', + style: true + }, + 'vant' ] +] +module.exports = { + presets: [['@vue/cli-plugin-babel/preset', {useBuiltIns: 'usage', corejs: 3}]], + plugins } + ``` #### 使用组件