nuxt.js 开发兼容ie浏览器的es6 转码
安装
npm install babel-polyfill -s
引入 polyfill
// plugins/ployfill.js
import 'babel-polyfill';
配置config.js
// config.js
plugins: [
{
src: '@/plugins/polyfill'
}
]
跟目录下创建 .babelrc
// .babelrc文件
{
"presets": [
"es2015","stage-0","stage-3"
]
}