vue-axios

作者: 除了吃就是睡 | 来源:发表于2017-08-31 17:37 被阅读0次

引入部分

import axios from 'axios'

方法部分

methods: {
    add() {
      self = this
      axios.get('http://www.easy-mock.com/mock/5990199fa1d30433d85fa4b6/care/list/info').then(response => {
        // console.log(response.data)
        self.list = (response.data)
      }, response => {
        alert("错误")
      })
    }
  }

html部分

<template>
  <div id="part">
    <button id="btn" @click="add">
      点我
    </button>
    <p id="content"></p>
    <ul class="page-loadmore-list">
      <li v-for="item in list" class="list">在|{{item.EventTime}}|去|{{item.EventAddress}}|准备|{{item.EventName}}</li>
    </ul>
  </div>
</template>

相关文章

  • 模仿的音乐webapp

    基于 Vue(2.5) + vuex + vue-router + vue-axios +better-scrol...

  • 开发中的axios

    [axios npm地址]https://www.npmjs.com/package/vue-axios 安装日常...

  • Vue框架+axios使用详细教程

    1、安装 npm install --save axios vue-axios或 cnpm install --s...

  • vue使用axios

    先npm install axios再npm install --save axios vue-axios安装成功...

  • vuecliPC项目笔记

    vue-axios跨域使用 在config.index.js设置本地代理 proxyTable: { '/api'...

  • vue 网络请求封装笔记

    准备工作 1.引入axiosnpm install --save axios vue-axios引入qs npm ...

  • vue-Axios

    基于Promise 用于浏览器和 node.js的与服务器通讯的库支持Promise API安装 使用 npm: ...

  • vue-axios

    1.引进axios import axios from 'axios' 2.配置默认基准路径 axios.defa...

  • vue-axios

    引入部分 方法部分 html部分

  • vue-axios

    两种引用的方法 通过cdn或者下载下来去引用 或者通过npm使用看了这么多文章通过自己的尝试 1 npm i ax...

网友评论

      本文标题:vue-axios

      本文链接:https://www.haomeiwen.com/subject/wotcjxtx.html