成人在线亚洲_国产日韩视频一区二区三区_久久久国产精品_99国内精品久久久久久久

您的位置:首頁技術(shù)文章
文章詳情頁

vue ajax請(qǐng)求回來的數(shù)據(jù)沒有渲染到頁面

瀏覽:129日期:2023-06-13 08:06:03

問題描述

//子組件列表 <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)求回來數(shù)據(jù)進(jìn)行了綁定,但是組件中列表中的數(shù)據(jù)沒有改變,這難道還要重新渲染一次子組件嗎;

vue ajax請(qǐng)求回來的數(shù)據(jù)沒有渲染到頁面

問題解答

回答1:

success函數(shù)里的this不等于組件事例吧

標(biāo)簽: vue
相關(guān)文章: