//子组件列表
<ForecastList :items='list'></ForecastList>
//实例
data: function () {
return {
data:{},
Model:{},
list:{}
};
},
components:{
ForecastList
},
mounted:function() {
$('#slider').find('span').on('click',function(){
$.ajax({
url: urlgeren,
data:{'gameName':type,"pn":1},
dataType: "json",
jsonp: "cb",
dataType: 'jsonp',
success: function(data){
this.data=data
this.Model = data.Model
this.list = data.Model.list
}.bind(this)
});
}在父组件中点击按钮,已经请求回来数据进行了绑定,但是组件中列表中的数据没有改变,这难道还要重新渲染一次子组件吗;

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
success函数里的this不等于组件事例吧