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>

快捷方式

相关推荐
用户298698530141 天前
React 前端实现 Excel 与 HTML 双向转换:基于 WebAssembly 的浏览器端方案
javascript·html·excel
htzyl2062 天前
前端样式-弹窗淡入淡出,为什么你的 `transition` 一直不生效
前端·css·html
zhanlang02172 天前
HTML 零基础入门到企业实战【第七章 7.5】表单验证基础属性:required、maxlength、placeholder
前端·html
SEO_juper3 天前
Node.js 全站 SEO 体检报告生成器:一次查完标题、描述、canonical、H1、图片
开发语言·前端·node.js·html·bash
zhanlang02173 天前
HTML 零基础入门到企业实战【第七章 7.2】form 标签属性:action、method、name、target 详解
前端·html
feixing_fx4 天前
CSS 变量(Custom Properties):构建可扩展的主题切换系统
前端·css·前端框架·html·css3
zhanlang02174 天前
HTML 零基础入门到企业实战【第七章 表单标签|7.1 表单核心作用:数据收集、用户交互原理】
前端·html·交互
思特奇时空智能4 天前
大规模点要素地图渲染性能优化实践
vue.js·arcgis·性能优化·node.js·html·gis·webgl
Brookty4 天前
HTML基础知识:表格布局、表单数据提交、元素标识与资源相对路径
前端·html
zhanlang02175 天前
HTML 零基础入门到企业实战【第六章 表格标签】6.3 单元格合并:跨行 rowspan、跨列 colspan 实战技巧
前端·html