NGA*_*YEN 5 babeljs babel-polyfill vuetify.js vue-cli-3
我在我的项目中使用 Vue CLI 3 和 Vuetify。它在 Chrome 和 iOS 12 上运行良好,但在 IE11 和 iOS Safari < 12 上显示空白页面。 IE11 中的控制台显示:SCRIPT1003: Expected ':'
我认为这是因为 Babel 没有将 ES6 语法(箭头函数、展开等)转换为 ES5 语法。运行 yarn build 后,我仍然在编译后的代码中看到它。
这是我的 babel.config.js:
//bable.config.js
module.exports = {
presets: [
[ '@vue/app', {
useBuiltIns: 'entry'
}]
]
}
Run Code Online (Sandbox Code Playgroud)
这是我的.browserslistrc:
//.browserslistrc
> 1%
last 2 versions
not ie <= 8
Run Code Online (Sandbox Code Playgroud)
main.js 是这样的:
// main.js
import '@babel/polyfill'
import Vue from 'vue'
import './plugins/vuetify'
import App from './App.vue'
import router from './router'
import store from './store/store'
import { firebaseListener } from './firebaseConfig'
Vue.config.productionTip = false
Run Code Online (Sandbox Code Playgroud)
请帮我!感谢致敬。
babel.config.js
module.exports = {
presets: [['@vue/app', { useBuiltIns: 'entry' }]],
}
Run Code Online (Sandbox Code Playgroud)
main.js
import '@babel/polyfill' // At the top of the file, and make sure @babel/polyfill is installed
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2015 次 |
| 最近记录: |