码迷,mamicode.com
首页 >  
搜索关键字:promise    ( 2095个结果
Xhr
xhr Learning 续2、AxiosAxios文档定义:Axios 是一个基于 promise 的 HTTP 库,可以用在浏览器和 node.js 中安装:$ npm install axios引入: import axios from 'axios' cdn: https://unpkg.c... ...
分类:其他好文   时间:2020-02-25 12:50:41    阅读次数:120
request.js(封装请求文件)
// 请求方法 /** * url 请求地址 * data 请求数据 * header 带有签名信息的请求头 */ export function request(url,data,header){ return new Promise((resolve,reject) => { wx.reques ...
分类:Web程序   时间:2020-02-25 12:40:07    阅读次数:251
Vue之axios基础使用
axios 简介 axios 是一个基于Promise 用于浏览器和 nodejs 的 HTTP 客户端,它本身具有以下特征: 从浏览器中创建 XMLHttpRequest 从 node.js 发出 http 请求 支持 Promise API 拦截请求和响应 转换请求和响应数据 取消请求 自动转换 ...
分类:移动开发   时间:2020-02-22 23:51:59    阅读次数:94
async 及 await
ES7 中的 async 及 await就是 Generator 以及 Promise 的语法糖,内部的实现原理还是原来的,只不过是在写法上有所改变,这些实现一些异步任务写起来更像是执行同步任务。 一个函数前加上 async关键字,就将该函数返回一个 Promise,async 直接将返回值使用 P ...
分类:其他好文   时间:2020-02-22 22:21:07    阅读次数:77
JavaScript - request封装
request封装——微信小程序使用async,await ES5 参考代码 ES6——promise 这里以微信小程序开发为例,jquery同理 考虑到加载图标 使用前需要引入request.js文件(更换为自己的文件目录) 使用promise的then方法获取数据 ES7——async,awai ...
分类:编程语言   时间:2020-02-22 17:21:53    阅读次数:303
Vue:Axios异步通信、计算属性、内容分发、自定义事件
1. Axios 什么是Axios Axios 是一个开源的可以用在浏览器端和 NodeJS 的异步通信框架,她的主要作用就是实现 AJAX 异步通信,其功能特点如下: 从浏览器中创建 XMLHttpRequests 从 node.js 创建 http 请求 支持 Promise API [JS中链 ...
分类:移动开发   时间:2020-02-22 12:22:41    阅读次数:109
vue router 报错: Uncaught (in promise) NavigationDuplicated {_name:""NavigationDuplicated"... 的解决方法
今天在写vue-music的时候,发现每次跳转路由都会出现这个错误,于是上网查了一下解决的方法 在main.js中添加 import Router from 'vue-router' const originalPush = Router.prototype.push Router.prototyp ...
分类:其他好文   时间:2020-02-22 09:57:23    阅读次数:97
async/await语法总结
console.dir(Promise); const p = new Promise((resolve, reject) => { reject("失败"); resolve("成功!"); }) async function getA(){ // await后是一个Promise,如果不是也会默 ...
分类:其他好文   时间:2020-02-21 18:33:18    阅读次数:116
[Javascript] Wait for the Fastest JavaScript Promise to Be Fulfilled with Promise.any()
The Promise.any() method accepts an array (or any other iterable) of promises as a parameter. It returns a Promise object that is fulfilled with the v ...
分类:编程语言   时间:2020-02-20 20:09:40    阅读次数:69
[Javascript] Wait for Multiple JavaScript Promises to Settle with Promise.allSettled()
The Promise.allSettled() method accepts an array (or any other iterable) of promises as a parameter. It returns a Promise object that is fulfilled wit ...
分类:编程语言   时间:2020-02-20 18:45:55    阅读次数:87
2095条   上一页 1 ... 38 39 40 41 42 ... 210 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!