vue: how to make the object passed to component reactive?
问题 Codepen Demo I have a component which has an location object as props . The argument I passed in is locations[index] which is a selected item from a locations array. However, the component cannot react when the index change. As you can see in the demo, the JSON change as you click the button, but the component cannot update. What's the best way to make the component reactive? 回答1: Your location component populates the province and city data properties in the mounted hook only. When the