<div class="detail-top">
<ul v-for="pro in info_in">
<li>{{pro.price}}</li>
<li>{{pro.num}}</li>
</ul>
</div>
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:{},
},
methods:{
datas: function (type,ext){
$.ajax({
type:"GET",
url:"/trade_data",
data:{type:type,ext:ext},
datatype:"json",
success: function(reslue){
this.info = resule;
}.bind(this)
})
}
}
})
怎么调用显示在页面?ul li 里面显示
***已解决***:
<div class="detail-top">
<ul >
</ul>
</div>
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;
}
})
}
})
感谢各位回答
<div class="detail-top">
</div>
var vm = new Vue({
})