Dowemo

The problem with vue in ie 9.

Recent projects are developed with vue, and we're also compatible with this pit in this process, where I write a little bit of the pit.

  • development: vue + vue-cli + axios + router + iview + mock

First, we follow the steps to install the vue cli
Create project run


npm install


npm run dev






Then we opened the discovery in ie 9, but the vue website told us that he was compatible with ie 9. 这里写图片描述

Address: https://github. com/vuejs/vue.

The following illustration is an error prompt ie:
这里写图片描述
And then find the document, and I'll find it.
It's simple to implement, just need to download a babel polyfill.


npm install babel-polyfill --save-dev






How do we use it after downloading?
At this point we'll find the build folder under the web pack. Base. Conf. Js.


module.exports = {


 entry: {


 app: './src/main.js'


 },






Change to


module.exports = {


 entry: {


 'babel-polyfill': 'babel-polyfill',


 app: './src/main.js'


 },






It's ok. It's simple.

The second question is that axios 's request isn't used in ie.
How to solve this.
It's just to download js is problem.
Just put the code directly.


npm install es6-promise --save-dev







/*main.js下*/


 import promise from 'es6-promise'


 promise.polyfill()






( you've just started to contact vue, please )
To continue.




Copyright © 2011 Dowemo All rights reserved.    Creative Commons   AboutUs