[Vuejs]-VueJS new values to props getting pushed instead of reset

0👍

vue reuses components – use key to force mounting


Change

<LiefermaxMap style="width: 100%; height: 50%;" :waypoints="waypoints" :driver="driverLocation" :stopOver="showCalculatedTour"></LiefermaxMap>

to

<LiefermaxMap style="width: 100%; height: 50%;" :key="waypoints" :waypoints="waypoints" :driver="driverLocation" :stopOver="showCalculatedTour"></LiefermaxMap>

use key to tell vue not to reuse the component – so mounted can be triggered,

or move your initMap method.

Leave a comment