Testing 测试Vue.js(^2.5.*)组件时,如何处理有关道具发生变异的警告消息
在测试安装了Vue utils的组件时,我遇到以下错误消息:Testing 测试Vue.js(^2.5.*)组件时,如何处理有关道具发生变异的警告消息,testing,vue.js,vuejs2,Testing,Vue.js,Vuejs2,在测试安装了Vue utils的组件时,我遇到以下错误消息: 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: <prop name> 避
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: <prop name>
避免直接改变道具,因为该值将被覆盖
每当父组件重新渲染时。
相反,使用基于道具值的数据或计算属性。正在变异的支柱:
安装要测试的组件时,为了防止错误消息显示在控制台中,请将sync
选项传递到mount
功能。另请参见当安装要测试的组件时,为了防止错误消息显示在控制台中,请将sync
选项传递到mount
功能。另请参见是的,这是绝对正确的,除非问题已经存在,请参见。我没有发现与安装在测试环境中的组件相关的类似问题。是的,这是绝对正确的,除非问题已经存在,请参阅。我没有发现与测试环境中安装的组件相关的类似问题。