zoukankan      html  css  js  c++  java
  • vue resource

    注册

    import VueResource from 'vue-resource'
    
    Vue.use(VueResource)
    

      

    使用

    this.$http
    

      

    两个例子:

      created () {
        this.$http.post('getList', {userId: 123})
          .then((response) => {
            console.log(response)
          }, (err) => { console.log(err) })
        // this.$http.get('getList')
        //   .then((response) => {
        //     console.log(response)
        //   }, (err) => { console.log(err) })
      },
    

      

  • 相关阅读:
    Activity
    日志
    StringBuffer
    内部类
    接口
    多态
    final关键字
    abstract关键字
    对象初始化
    继承
  • 原文地址:https://www.cnblogs.com/tabCtrlShift/p/9164324.html
Copyright © 2011-2022 走看看