vue ajax請(qǐng)求回來(lái)的數(shù)據(jù)沒(méi)有渲染到頁(yè)面
問(wèn)題描述
//子組件列表 <ForecastList :items='list'></ForecastList> //實(shí)例 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) }); }
在父組件中點(diǎn)擊按鈕,已經(jīng)請(qǐng)求回來(lái)數(shù)據(jù)進(jìn)行了綁定,但是組件中列表中的數(shù)據(jù)沒(méi)有改變,這難道還要重新渲染一次子組件嗎;
問(wèn)題解答
回答1:success函數(shù)里的this不等于組件事例吧
相關(guān)文章:
1. css3 - sublime text2 的less2css插件怎么使用2. javascript - 微信公眾號(hào)網(wǎng)頁(yè)使用redux如何管理用戶刷新?3. css3 - 求clearfix使用方法4. html5 - z-index在瀏覽器調(diào)試有效 手機(jī)測(cè)試無(wú)效5. javascript - 微信小程序 如何實(shí)現(xiàn)這種左滑動(dòng)出現(xiàn)刪除的辦法?有相關(guān)api嗎?6. css - 不用position:absolute怎么實(shí)現(xiàn)類似的功能7. angular.js - angularjs的自定義過(guò)濾器如何給文字加顏色?8. 關(guān)于docker下的nginx壓力測(cè)試9. angular.js使用$resource服務(wù)把數(shù)據(jù)存入mongodb的問(wèn)題。10. docker-machine添加一個(gè)已有的docker主機(jī)問(wèn)題
