当前位置: 首页 > news >正文

北京有一个公司打电话做网站认证seo赚钱

北京有一个公司打电话做网站认证,seo赚钱,网页更改,单位网站建设论文介绍 Axios对原生Ajax进行了封装&#xff0c;简化书写&#xff0c;快速开发 官网&#xff1a;Axios中文文档 | Axios中文网 (axios-http.cn) 入门 1引入Axios的js文件 <script src"js/axios.js"></script> 2使用Axios发送请求&#xff0c;并获取响应…

介绍

Axios对原生Ajax进行了封装,简化书写,快速开发

官网:Axios中文文档 | Axios中文网 (axios-http.cn)

入门

1引入Axios的js文件

 <script src="js/axios.js"></script>

2使用Axios发送请求,并获取响应结果

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTE-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=l.0"><title>Ajax</title><script src="js/axios.js"></script>
</head><body><input type="button" value="获取数据Get" onclick="get()"><input type="button" value="获取数据Post" onclick="post()"></body>
<script>function get(){axios({ mehod:"get",url:"http://yapi.smart-xwork.cn/mock/169327/emp/list"}).then(result=>{console.log(result);})}function post(){axios({ mehod:"post",url:"http://yapi.smart-xwork.cn/mock/169327/emp/deleteById",data:"id=1;"}).then(result=>{console.log(result);})}</script></html>

axios({....对象信息....mehod,url(data)}).then(result)=>{}           

then后面接一个result的自定义函数

post有个而外的data

请求方式别名

改写

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTE-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=l.0"><title>Ajax</title><script src="js/axios.js"></script>
</head><body><input type="button" value="获取数据Get" onclick="get()"><input type="button" value="获取数据Post" onclick="post()"></body>
<script>// function get(){//      axios({ mehod:"get",//        url:"http://yapi.smart-xwork.cn/mock/169327/emp/list"//   }).then(result=>{//      console.log(result);//   })// }axios.get("http://yapi.smart-xwork.cn/mock/169327/emp/list").then(result=>{console.log(result);})// function post(){//      axios({ mehod:"post",//       url:"http://yapi.smart-xwork.cn/mock/169327/emp/deleteById",//       data:"id=1;"//     }).then(result=>{//         console.log(result);//     })//}axios.post("http://yapi.smart-xwork.cn/mock/169327/emp/deleteById", "id=1").then(result=>{console.log(result);})</script></html>

案例:网页加载完成,调用vue生命周期的mounted()向服务器发送请求返回数据赋值遍历渲染表格

数据

代码

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTE-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=l.0"><title>Vue-快速入门</title>
<script src="js/vue.js"></script></head>
<script src="js/axios.js"></script>
<body>
<div id ="app"><table border="1"cellspacing="0" width="60%"><tr><th>编号</th><th>姓名</th><th>图像</th><th>性别</th><th>职位</th><th>入职时间</th><th>最后操作时间</th></tr><tr v-for="(emp,index) in emps" align="center"><th>{{index+1}}</th><th>{{emp.name}}</th><th><img : src="emp.image" width="70px" height="50px"></th><th v-if="emp.gender=1">男</th><th v-else>女</th><th>{{emp.jop}}</th><th>{{emp.entrydate}}</th><th>{{emp.updatetime}}</th></tr></table>
</div>
</body>
<script>
//定义vue对象new Vue({el:"#app",//vue接管区域data:{emps:[]},methods:{},mounted(){axios.get("http://yapi.smart-xwork.cn/mock/169327/emp/list").then(result=>{this.emps=result.data.data;})}})
</script>
</html>

http://www.hotlads.com/news/5405.html

相关文章:

  • 网站建设合同要求百度浏览器官网
  • 做网站开发很赚钱吗南京市网站seo整站优化
  • 手机做网站的软文广告案例
  • 曲阜网站制作合肥seo网站建设
  • 苏州建设网官网台州关键词首页优化
  • 网站建设好学么电商沙盘seo裤子关键词
  • 前端制作个人网站什么叫做优化
  • 哪个浏览器可以看禁止访问的网站云优化软件
  • 网站banner 代码排名点击工具
  • 马云为什么做网站百度账号管家
  • 齐齐哈尔做网站的公司产品宣传方案
  • 济宁城乡住房建设网站成都seo顾问
  • 用别人服务器做网站wordpress网站建设
  • 做网站维护和客服需要学什么广西疫情最新消息
  • 网站开发流程原理软文素材
  • 游仙区专业网站建设价格关键词挖掘工具
  • 做英语在线翻译兼职网站网站收录批量查询
  • 深圳网站建设服务便宜seo关键词优化报价价格
  • 做移动网站快速廊坊seo整站优化软件
  • 益阳市网站建设科技网络营销的主要方法
  • 自主建站seo技术优化服务
  • 可视化网站开发工具关键词优化营销
  • 网站建设费用 做个网站要多少钱最好的推广平台排名
  • 长沙做网站咨询公司开源crm系统
  • 做网站要求高吗网络营销课程速成班
  • 同制作网站一样都是在seo优化网站的手段
  • 海淘网站建设的目的淘宝网店怎么运营起来
  • 是做网站的怀孕后自己做网站需要多少钱
  • 长沙做公司网站商丘关键词优化推广
  • wordpress 图片能不能存到seo专业培训中心