随笔分类 -  ajax

ajax的一些知识
摘要:借鉴: https://blog.csdn.net/m0_48468380/article/details/121577011 流程图 贴下封装的request.js代码 import axios from "axios"; import JsCookie from "js-cookie"; imp 阅读全文
posted @ 2022-12-15 09:59 huihuihero 阅读(800) 评论(0) 推荐(0)
摘要:安装axios依赖 yarn add axios 或 npm install axios --save src目录下创建相关文件夹 相关文件内容 【config/request.js】 import axios from "axios"; // import store from "@/store" 阅读全文
posted @ 2022-09-16 15:51 huihuihero 阅读(208) 评论(1) 推荐(0)
摘要:###GET import axios from 'axios' 1 getData(){ let config={ method:'GET', params:{ page:this.page, pagesize:this.pageSize, }, } axios(`${api.base}/getd 阅读全文
posted @ 2020-04-16 15:30 huihuihero 阅读(177) 评论(0) 推荐(0)
摘要:js写法 } $(function(){ $("input").on("click",function(){ $.ajax({ url:"./callback.php", //请求地址 type:"get", //请求方式 data:"name=林子闲&wife=乔韵", //这里的data:发送给 阅读全文
posted @ 2019-05-01 22:23 huihuihero 阅读(5159) 评论(0) 推荐(2)