13_axios实现网络请求

npm install --save axios

html 复制代码
<template>
  <div id="hello">
   
  </div>
</template> 

<script>
import axios from 'axios';

  

export default {
  name: 'HelloComponent',
  data(){
    return{
      msg: ''
    }
  },
  methods: {
  
  },
  mounted(){
    axios({
      method: 'get',
      url: 'http://iwenwiki.com/api/blueberrypai/getchengpinDetails.php'
    }).then(res=>{
      console.log(res.data);
      
    })
  }
};
</script>

快捷方式

相关推荐
xxwl5851 小时前
HTML 小总结:从骨架到枝叶,系统掌握网页结构
前端·html
blns_yxl20 小时前
购物车(HTML+JS+CSS)
html
blns_yxl1 天前
正则驱动实时表单验证(HTML+CSS+JS+正则)
javascript·css·html
大白要努力!1 天前
纯前端实现 PDF 加水印工具 —— 零后端、支持中文、实时预览
前端·pdf·html
蜡台1 天前
使用 uni-popup 实现数据选择器Data-Picker
前端·javascript·html·uniapp·uni-popup·data-picker
blns_yxl1 天前
Promise封装Fetch + 重试机制(HTML+JS)
前端·javascript·html
杨超越luckly2 天前
Agent应用指南:13年与13线——武汉地铁进化史
数据分析·html·agent·可视化·地铁客流
葡萄城技术团队2 天前
HTML元素单元格:用自定义 CellType 扩展 SpreadJS 的显示能力
前端·javascript·html
逝水无殇2 天前
HTML 属性(HTML Attributes)详解
开发语言·前端·html·html5
码农学院3 天前
2026年生成式搜索引擎优化对服务业本地化获客帮助的数字化转型路径
前端·搜索引擎·html