Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
613 views
in Technique[技术] by (71.8m points)

vuejs2 - VUE CLI-3 Project not working on IE-11

I have created an project in vuejs using vue-cli3. It working fine on chrome browser but in IE-11 version blank screen is shown with the following error in console as mentioned in this link: https://drive.google.com/file/d/1QaNwK1ekI2BwFsFyjvgbSsvwHBCmlcAD/view?usp=drivesdk On clicking console error that I have pointed in above screenshot, it opens a screen as display in given link https://drive.google.com/file/d/1_QXVjcw3cmqeC70LfNyLcr__rnXVIZIh/view?usp=drivesdk with the error in mini-toastr package: Here is my babel.config.js file code:

module.exports = {
  presets: [
   ['@vue/app', {
      polyfills: [
        'es6.promise',
        'es6.symbol'
      ]
    }]
  ]
}

and .browserslistrc file code :

> 1%
last 2 versions
not ie <= 8

I am not getting where I am doing a mistake. Is anything I am missing? If anyone need some more info please let me know. Thanks!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I finally ended up with the solution of above issue. To run project on IE-11 version just follow the 2 steps:

  1. Install babel-polyfill using command "npm install --save babel-polyfill".
  2. Import babel-polyfill in your main.js or index.js file at the top of above all imported packages. For e.g Here is your main.js file.

Note: If you import babel-polyfill at the end it does't work.

import 'babel-polyfill'  
import Vue from 'vue'
import Vuetify from 'vuetify'

import router from './router'
// include script file
import './lib/DemoScript'

// include all css files
import './lib/DemoCss'

Vue.use(Vuetify)

new Vue({
    store,
    router,
    render: h => h(App),
    components: { App }
}).$mount('#app')

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...