我得到了一个Vue应用程序,它在Chrome,Firefox上运行得很好。但在IE-11和Ms Edge中的空白页。在控制台里没有Erorrs。我不是Vue开发人员,但我对Vue感兴趣。所以试着找一个搜索它的解决方案。但这些解决方案中没有一个对我有效。有人能告诉我如何解决IE-11 &Edge中的这个空白页面问题吗?
main.js
import 'babel-polyfill'
import Vue from 'vue'
import Request from './http/request'
const EXCLUDED_PROD = [
'52.59.217.237',
'localhost'
]babel.config.js
module.exports = {
presets: [
['@vue/app', {
polyfills: [
'es6.promise',
'es6.symbol'
]
}]
]
}index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>fav.png">
<title>Starline Security</title>
</head>
<body>
<noscript>
<strong>We're sorry but Starline Security doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!--built files will be auto injected-->
</body>
</html>package.json
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]发布于 2020-07-06 06:52:16
如何创建vue项目?我根据此链接创建vue项目,并选择default。它可以在IE和Edge中运行良好,而无需安装其他软件包。
我比较了工作项目中的文件和您的文件,babel.config.js和package.json是不同的。您可以试着按照下面的方式编辑babel.config.js和package.json。
babel.config.js:
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}package.json:
{
"name": "hello-world",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.6.5",
"vue": "^2.6.11"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.4.0",
"@vue/cli-plugin-eslint": "^4.4.0",
"@vue/cli-service": "^4.4.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"vue-template-compiler": "^2.6.11"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}此外,您的main.js似乎不完整。我的是这样的:
import Vue from 'vue'
import App from './App.vue'
Vue.config.productionTip = false
new Vue({
render: h => h(App),
}).$mount('#app')https://stackoverflow.com/questions/62692614
复制相似问题