父组件data(){mapArr:[],}proChange(params){letmapArr;this.prolistData.forEach((item,i)=>{if(item.areaid==this.params.proid){mapArr=item;}});console.log("mapArr",mapArr);},子组件props:["makerData","markerId","mapName","proData","applyFlag"],watch:{proData:function(val,oldVal){console.log("====41",val);if(val){this.mapPosition(this.proData);}},},mapPosition(mapArr){console.log(mapArr);this.map.centerAndZoom(newT.LngLat(mapArr.longitude,mapArr.latitude),mapArr.zoom);},mapPosition我在父组件改变mapArr的值子组件mapPosition这个方法不执行
添加回答
举报
0/150
提交
取消