地图主组件向副组件传递数据
1.在主组件先定义一个地图,我们想向后台传递我的searchCondition中的month和yearFlag。
`<overMap style="height: 550px;width: 100%" :month="searchCondition.month" :key="timer" :yearFlag="searchCondition.yearFlag"></overMap>`
searchCondition:{
vehicleModel:'',
month:'',
yearFlag:false,
},
2.在副组件声明一个props来接受主组件的内容
props:['month','yearFlag'],
3.这样就把地图主组件的month和yearFlag传递到副组件了。