vuejs双向绑定

如果直接把一个东西传入自己创建的一个vue的component,就会导致这个只是单向绑定,报错:

[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop’s value. Prop being mutated: “store”

但是我发现,如果不是裸类型(这里我用的一个字符串),就可以双向。所以我传进去了一个类的实例,在自己的component里面用它的一个属性,这就解决了