var myFocusDatas = {myFocusList: []}; Vue.component('my_focus',{ template: '
'+ '
我的关注
'+ '
'+ ''+ '
'+ '
' , data:function(){ return myFocusDatas; }, methods:{ loadMyFocus:function(){ if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){ $("#myFocusFirstPage").hide() $("#myFocus").hide(); }else{ axios.get("/rest/quotations/userCollectCityInfo").then(function(response){ if(response.data.data.length==0){ $("#myFocusFirstPage").hide(); $("#myFocus").hide(); }else{ myFocusDatas.myFocusList = response.data.data; } }).catch(function(error){ console.log(error) }) } } },mounted:function(){ this.loadMyFocus(); } }) function reloadMyFocus(){ if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){ $("#myFocusFirstPage").hide() $("#myFocus").hide(); }else{ axios.get("/rest/quotations/userCollectCityInfo").then(function(response){ if(response.data.data.length==0){ $("#myFocusFirstPage").hide(); $("#myFocus").hide(); }else{ myFocusDatas.myFocusList = response.data.data; $("#myFocus").show() } }).catch(function(error){ console.log(error) }) } }