简体   繁体   中英

Importing the es6-promise polyfill into Vue.js

I am having problems loading a Vue component containing axios in older version of Android. After some research it pointed towards the browser not supporting Promises, hence the polyfill.

I have installed and imported the polyfill but still having problems.

import Promise from 'es6-promise';

Is the above correct? Or is there a further problem?

I have following line on top of my main.js:

require('es6-promise').polyfill()

other variant of it's use you can see in vue-hackernews-2.0 here :

import 'es6-promise/auto'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM