The preface

I just finished watching Slasher in the Snow, and I feel like A bitch

  • Heaven does not give birth to me Li Chungang, as long as the night 😃

Results the second day received a live, Vue2.0 compatible IE, their computer is Win11, there is no IE environment, ah this….

It is not convenient to take the company’s project to show, you can create a new environment, XDM does not need the environment, directly pull the following

Environment to prepare

npm uninstall @vue/cli -g
cnpm install vue-cli -g
vue init webpack project-name
? Project name project-name
? Project description A Vue.js project
? Author chenshengqiang <[email protected]>
? Vue build standalone
? Install vue-router? Yes
? Use ESLint to lint your code? Yes
? Pick an ESLint preset Standard
? Set up unit tests Yes
? Pick a test runner jest
? Setup e2e tests with Nightwatch? Yes
? Should we run `npm install` for you after the project has been created? (recommended) npm

Copy the code

After installing dependencies

The theory of

Administration zhiyuan, theory first. Prepare the pre-knowledge

Is Vue compatible with IE?

Right now. As it says in this document,

So what is the ES5? Don’t worry, there are someAir ticketsIt’s in English. Take your time

How is Vue compatible with IE

Vue2.0 is compiled in WebPack, so that’s probably working on webpack. Several plug-ins are required

1. Babel-polyfill is used to transform JS syntax 2. Es6-promise does not support the shims that promise needs to use this pack 3. Classlist - Polyfill native Element. Classlist gasketCopy the code

MDN tickets for Classlist

On the whole

cnpm i babel-polyfill es6-promise babel-preset-es2015 classlist-polyfill -D
Copy the code
  • mian.js

  • build/webpack.base.js

  • .babelrc

  • index.html

Special handling

Some of the packages in node_modules need to be converted with Babel

  • build/webpack.base.conf.js

conclusion

This counts as accomplished, if there is no place, please criticize and correct

The article recommended

  • ✍ technical summary | front of new now get on the bus Docker, still in time?
  • ✍ Use these skills to help improve development efficiency
  • ✍ interviewer now ask call, apply, bind. Come on, I’ll write one for you!
  • ✍ small white to understand | 15 minutes vue/cli complete server based rendering