vue.js的params传数据为什么只能接收到id其他传不过?

created: function() {

      this.getCustomers();//调用方法;
    },
    watch: {
        '$route': 'getCustomers'
    },
    methods: {
        getCustomers: function(){
            /*this.$http.get(this.apiUrl)
                .then((response) =>{
                    this.$set('tasks',response.body.data)
                })
                .catch(function(response){
                    //console.log(response)
                })*/
            var that = this;
            that.$http.get('/static/api/detail.json', {
                 params:{
                     this.title:'10',
                 }
            }).then(function(response){
                this.tasks = response.data.shop;
            },function(response){
                //error
            })
        }
    }
阅读 2.8k
1 个回答
 params:{
     this.title:'10', // 這樣不對吧...
     title: '10', // 這樣才正確
 }
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题