readme
Showing
1 changed file
with
12 additions
and
5 deletions
... | @@ -222,13 +222,16 @@ module.exports = { | ... | @@ -222,13 +222,16 @@ module.exports = { |
222 | 222 | ||
223 | #### 安装插件 | 223 | #### 安装插件 |
224 | 224 | ||
225 | ```javascript | 225 | ```bash |
226 | npm i babel-plugin-import -D | 226 | npm i babel-plugin-import -D |
227 | ``` | ||
228 | |||
229 | 在` babel.config.js` 设置 | ||
230 | |||
231 | ```javascript | ||
227 | 232 | ||
228 | // 对于使用 babel7 的用户,可以在 babel.config.js 中配置 | 233 | // 对于使用 babel7 的用户,可以在 babel.config.js 中配置 |
229 | module.exports = { | 234 | const plugins = [ |
230 | presets: [['@vue/cli-plugin-babel/preset', {useBuiltIns: 'entry'}]], | ||
231 | plugins: [ | ||
232 | [ | 235 | [ |
233 | 'import', | 236 | 'import', |
234 | { | 237 | { |
... | @@ -238,8 +241,12 @@ module.exports = { | ... | @@ -238,8 +241,12 @@ module.exports = { |
238 | }, | 241 | }, |
239 | 'vant' | 242 | 'vant' |
240 | ] | 243 | ] |
241 | ] | 244 | ] |
245 | module.exports = { | ||
246 | presets: [['@vue/cli-plugin-babel/preset', {useBuiltIns: 'usage', corejs: 3}]], | ||
247 | plugins | ||
242 | } | 248 | } |
249 | |||
243 | ``` | 250 | ``` |
244 | 251 | ||
245 | #### 使用组件 | 252 | #### 使用组件 | ... | ... |
-
Please register or sign in to post a comment