Ant Design Vue is compatible with IE9! ! !

My big IE ( ̄^ ̄)

IE browser enters the countdown to elimination, Microsoft security experts urge users to give up!

IE9 no polyfill

The following is the performance of a simple demo written by me without introducing polyfill on IE9. The test environment is IE9 with IE11 modified document mode.
"Set" is not defined
The console may report the following error:

* Module not found: Error: Can't resolve 'core-js/modules/es.function.name'

IE9 polyfill

The following is the performance after I introduced the polyfill, tested some commonly used components, the performance is still quite good. Except for the dispensable Spin, this place has smoothly degenerated into this ugly look.
Insert picture description here

Application scenarios

Due to work needs, I believe that some people will need to make their projects compatible with IE9 . This sounds a bit inhumane, but this need can be easily achieved by configuring Babel. Don't talk nonsense, then go directly to the code.

main.js

Insert picture description here

package.json

Insert picture description here

babel.config

Insert picture description here

.browserslistrc

> 1%
last 2 versions

Here's a list of browser configuration, I am here to continue to use the default configuration Vue Cli, we can through the website results matching the query.

Realization principle

Here to focus on the picture directly, according to the configuration on the picture can solve the compatibility problem of IE9.
It may be due to a version upgrade of babel or other reasons, which caused me to report an error in accordance with the previous compatibility method. The guides on Babel's official website have all kinds of weird jumps, which makes people unable to find the rules. Here I also read the documentation bit by bit for a long time before trying it out. For a more in-depth understanding of the configuration items, you can check the Babel official website , this is the best solution to the root of your problem.

Updated on 2020-03-05 22:33

You can’t reply to comments, nor can you reply to yourself. Git address

Guess you like

Origin blog.csdn.net/dizuncainiao/article/details/102746582