Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vue.js/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Testing 测试Vue.js(^2.5.*)组件时,如何处理有关道具发生变异的警告消息_Testing_Vue.js_Vuejs2 - Fatal编程技术网

Testing 测试Vue.js(^2.5.*)组件时,如何处理有关道具发生变异的警告消息

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> 避

在测试安装了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>
避免直接改变道具,因为该值将被覆盖
每当父组件重新渲染时。
相反,使用基于道具值的数据或计算属性。正在变异的支柱:

安装要测试的组件时,为了防止错误消息显示在控制台中,请将
sync
选项传递到
mount
功能。另请参见

当安装要测试的组件时,为了防止错误消息显示在控制台中,请将
sync
选项传递到
mount
功能。另请参见

是的,这是绝对正确的,除非问题已经存在,请参见。我没有发现与安装在测试环境中的组件相关的类似问题。是的,这是绝对正确的,除非问题已经存在,请参阅。我没有发现与测试环境中安装的组件相关的类似问题。