将ajax的值赋给data,vue 2.0 methods 里ajax生成的数据,怎么赋值给data
·
var vm = new Vue({
el:'#all',
data:{
detail:[
{name:'五档',id:'0',iscur:true},
{name:'单价',id:'1',iscur:false},
{name:'数量',id:'2',iscur:false},
{name:'总价',id:'3',iscur:false},
],
info_in:[],
info_out:[]
},
mounted: function () {
var that = this;
$.ajax({
type:"GET",
url:"/trade_data",
data:{type:$_GET['type'],ext:$_GET['ext']},
dataType:"json",
success: function(result) {
that.info_in=result.in;
that.info_out=result.out;
}
})
}
})
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐


所有评论(0)