Home > front end >  Vue axios in IE browser, don't give force. What's the solution?
Vue axios in IE browser, don't give force. What's the solution?

Time:09-16


An error message, ReferenceError: "the Promise" undefined , the Internet is because IE does not support the latest ES6 syntax, the solution is given NPM what what of, see all look not to understand!

CodePudding user response:

Babel - polyfill can convert es6 grammar to ie can parse js, if directly with webpack packaging should have this plugin,

CodePudding user response:

reference 1st floor jio can reply:
Babel - polyfill can convert es6 grammar to ie can parse js, if use webpack packaging should have the plug-in directly,
is there a video explaining exactly how to do?

CodePudding user response:

CMD cut to the current directory:
NPM install, save the Babel - polyfill

The main. Js
The import 'Babel - polyfill'
https://babeljs.io/docs/en/6.26.3/babel-polyfill

CodePudding user response:

The
reference jio can reply: 3/f
CMD cut to the current directory:
NPM install, save the Babel - polyfill

The main. Js
The import 'Babel - polyfill'
https://babeljs.io/docs/en/6.26.3/babel-polyfill
video interpretation? 1) what is NPM tool? 2) main. Js is a what?

CodePudding user response:

 & lt; Script SRC="https://bbs.csdn.net/topics/${pageContext. Request. ContextPath}/js/vue. Js" type="text/javascript" & gt; </script> 
<script SRC="https://bbs.csdn.net/topics/${pageContext. Request. ContextPath}/js/axios. Js" type="text/javascript" & gt; </script>
<script SRC="https://bbs.csdn.net/topics/${pageContext. Request. ContextPath}/js/polyfill js" & gt; </script>

Tested, the introduction of a more polyfill. Js file, can solve the problem of the IE compatibility, but you said the NPM install way, don't know how to operate?

CodePudding user response:

With the yarn is the same, see the document to the above
Main. Js vue project entry file
Import 'XXXX' this is pretty then written into the script tag


CodePudding user response:

reference 5 floor HawkOfWinter reply:
 & lt; Script SRC="https://bbs.csdn.net/topics/${pageContext. Request. ContextPath}/js/vue. Js" type="text/javascript" & gt; </script> 
<script SRC="https://bbs.csdn.net/topics/${pageContext. Request. ContextPath}/js/axios. Js" type="text/javascript" & gt; </script>
<script SRC="https://bbs.csdn.net/topics/${pageContext. Request. ContextPath}/js/polyfill js" & gt; </script>

Tested, the introduction of a more polyfill. Js file, can solve the problem of the IE compatibility, but you said the NPM install way, don't know how to operate?



NPM install is to download the corresponding dependent on package, the project's package. The json can configure the need to install inside dependence by NPM install you can download the corresponding dependent package integration in nodemodule files, and estimate what does the vue is through direct introduction of vue. Js way, used the scaffold, can search the vue if collocation webpack building project download just know what is the structure, what's the use of NPM

CodePudding user response:

1) first of all, the search for download "node - v12.18.0 - x64. Msi, installed after the NPM tools,

2) the CMD cut to the current directory:
NPM install, save the Babel - polyfill executed, generate some folders, one of the folder has polyfill. Js and polyfill. Min. Js,
  • Related