1. Project environment
vue + vue-admin-template
Copy the code
2. The problem spot
Since the project was checked out by Party A for loopholes and sensitive data needed to be encrypted and decrypted, crypto-JS was introduced for development and chrome was tested online without any problems. Within 2 days, a problem was reported in IE, and the direct interface was blank. The project could not be opened completely. Finding a solution led to today's article. 2) Babel-polyfill has been introduced into main.js, and it does not work ???? (I don't know if it works, some people say it works, some people say it doesn't work, I don't care, whoever can solve my problem works, The crypto-js ES6 parameter fn (StrBase64 = false) was assigned a default valueCopy the code
3. What can be done to solve the problem? I this kind of low grade code baby farmers can only find Baidu)
Vue 3.0 does not have webpack.conf.js in it. It is so confusing that I have to go to The search engine to see if I can find one.
1). It must be installation
npm install --save babel-polyfill
Copy the code
2) Use it
Here is the configuration in vue.config.js
/// I heard that this is the key, very important, very important, I do not understand, I also dare not ask
transpileDependencies: ['element-ui'].chainWebpack:config= > {
config.entry('main').add('babel-polyfill')
{
Copy the code
3) test try (still white screen, at that time MY hair stood up, do not know how to be good, forget it, drink saliva on a toilet, I squat in the toilet of that moment, I suddenly remembered a word in Baidu, specify a file, is not I should not copy Baidu should change the element-UI crypto-js, it is possible, Wipe your ass, go back and try again, modify the following sample juice)
transpileDependencies: ['crypto-js'].Copy the code