美文网首页
vue饿了么学习--项目实战--头部组件开发-Vue-resou

vue饿了么学习--项目实战--头部组件开发-Vue-resou

作者: Monee121 | 来源:发表于2018-04-02 23:11 被阅读0次

https://github.com/pagekit/vue-resource
步骤1.先修改pakejson里vue-resource版本号,然后安装

npm install vue-resource

步骤2:引入到mian.js,和vue-router用法一样

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

步骤3:App.vue 调出mock里的seller

export default {
    data() {
      return {
        seller: {}
      }
    },
  created: function () {
    this.$http.get('/api/seller').then((response) => {
      console.log(response.body)
    })
  },

相关文章

网友评论

      本文标题:vue饿了么学习--项目实战--头部组件开发-Vue-resou

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