Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vue.js/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vue.js 对象在vue中的axios请求中未作为参数发送 继续 导出默认值{ 数据:函数(){ 返回{ 系列:[] } }, 方法:{ getData:函数(类型){ var=这个; 让url; 让数据; 数据={current_page:type,is_worker:true} url='myprofile/user.json' 这个.axios.get(url,{company:data}) 。然后(响应=>{ that.series=response.data.series }); } } };_Vue.js_Axios - Fatal编程技术网

Vue.js 对象在vue中的axios请求中未作为参数发送 继续 导出默认值{ 数据:函数(){ 返回{ 系列:[] } }, 方法:{ getData:函数(类型){ var=这个; 让url; 让数据; 数据={current_page:type,is_worker:true} url='myprofile/user.json' 这个.axios.get(url,{company:data}) 。然后(响应=>{ that.series=response.data.series }); } } };

Vue.js 对象在vue中的axios请求中未作为参数发送 继续 导出默认值{ 数据:函数(){ 返回{ 系列:[] } }, 方法:{ getData:函数(类型){ var=这个; 让url; 让数据; 数据={current_page:type,is_worker:true} url='myprofile/user.json' 这个.axios.get(url,{company:data}) 。然后(响应=>{ that.series=response.data.series }); } } };,vue.js,axios,Vue.js,Axios,我试图通过axios get请求传递数据对象,但参数未传递给控制器。请帮我找出哪里出了问题。@mare96 this.$axios.get(url,{params:{company:type,is_-worker:true})这样的it工作者。但我正在努力改进我的代码,这就是为什么我要创建一个数据对象并随请求一起发送它 <template> <div> <v-btn class="red-button next-btn" @click=&q

我试图通过axios get请求传递数据对象,但参数未传递给控制器。请帮我找出哪里出了问题。

@mare96 this.$axios.get(url,{params:{company:type,is_-worker:true})这样的it工作者。但我正在努力改进我的代码,这就是为什么我要创建一个数据对象并随请求一起发送它
<template>
 <div>
  <v-btn class="red-button next-btn" @click="getData("homepage")">
   Continue
  </v-btn>
 </div>
</template>

<script>

  export default {
    data: function() {
      return {
        series: []
      }
    },
    methods: {
      getData: function (type) {
        var that = this;
        let url;
        let data;        
        data = { current_page: type, is_worker: true }
        url = 'myprofile/user.json'
        this.$axios.get(url, { company: data })
        .then(response => {
          that.series = response.data.series
        });
      }
    }
  };
</script>