亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

VUE仿鏈家網,分頁時怎么從后臺服務器獲取數據,并展示在頁面上。

VUE仿鏈家網,分頁時怎么從后臺服務器獲取數據,并展示在頁面上。

慕田峪2258837 2019-05-22 20:13:55
https://github.com/wangjianliqq/Lianjiawang <v-pagination?:total="total"?:currentPage='current'?v-on:pageChange="pageChange"?class="sellBottom-fenye"></v-pagination> <script> import?axios?from?'axios' import?pagination?from?'./Pagination.vue' import?imgUrl1?from?'../house1.png' import?imgUrl2?from?'../house2.png' export?default?{ ??name:?'ErshoufangDetail', ??data?()?{ ????return?{ ??????total:?150, ??????pagingVolume:?10, ??????current:?1, ??????contentList:?[ ????????{imgUrl:?imgUrl1,?title:?'珠江路地鐵?君臨國際?精裝修?采光好視野好',?xiaoqu:?'君臨國際',?peizhi:?'|?1室1廳?|?52.7平米?|?北?|?其他?|?有電梯',?louceng:?'高樓層(共32層)2005年建板塔結合??-??',?daolu:?'華僑路',?guanzhu:?'191人關注?/?共16次帶看?/?一年前發布',?subway:?'近地鐵',?vr:?'VR房源',?five:?'房本滿兩年',?haskey:?'隨時看房',?totalPrice:?'160',?unitPrice:?'單價31099元/平米',?active1:?false,?active2:?true,?active3:?true,?active4:?false}, ????????{imgUrl:?imgUrl2,?title:?'新城市廣場摩爾特區?1室1廳?156萬',?xiaoqu:?'新城市廣場',?peizhi:?'|?1室1廳?|?51.45平米?|?北?|?精裝?|?有電梯',?louceng:?'中樓層(共12層)2005年建塔樓結合?-??',?daolu:?'龍江',?guanzhu:?'2人關注?/?共0次帶看?/?1個月以前發布',?subway:?'近地鐵',?vr:?'VR房源',?five:?'房本滿兩年',?haskey:?'隨時看房',?totalPrice:?'156',?unitPrice:?'單價29602元/平米',?active1:?true,?active2:?true,?active3:?false,?active4:?false} ??????] ????} ??}, ??methods:?{ ????pageChange:?function?(currentPage)?{ ??????console.log(currentPage) ????}, ????getPageInfo?()?{ ??????///?地址為后臺數據地址為后臺數據地址為后臺數據地址為后臺數據地址為后臺數據 ??????axios.get('http://47.110.132.127:9000/city/get') ????????.then(function?(res)?{ ??????????res?=?res.data ??????????if?(res.ret?&&?res.data)?{ ????????????const?data?=?res.data ????????????this.total?=?data.total ????????????this.pagingVolume?=?data.pagingVolume ????????????this.current?=?data.current ????????????this.contentList?=?data.contentList?///?前后名字一樣 ??????????} ????????})?///?先接受json文件,然后返回函數 ????????.catch(function?(error)?{ ??????????console.log(error) ????????}) ????} ??}, ??mounted?()?{ ????this.getPageInfo()?///?先寫個鉤子函數 ??}, ??components:?{ ????'v-pagination':?pagination ??} } </script>
查看完整描述

2 回答

  • 2 回答
  • 0 關注
  • 1550 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號