在vue的methods,函数search作用是返回请求数据,但是报错search(options){consturl=this.isTeacher?'/api/search_Teacher':'/apis/org/search_student';constparams=options.ids?{ids:options.ids}:{keyword:this.keyword};returnthis.$http.get(url,{params}).then((response)=>{returnresponse.body;},(err)=>{console.log(err);})},但是不明白如何调用这个search,获取到data??尝试下面的方法,报错,this.searchisnotafunction??this.seach({ids:this.selected}).then((res)=>{if(!res)this.$message.error('搜索失败');elsethis.selectedData=res;});有没有好的方法,谢谢
PIPIONE
相关分类