测试用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>
答案 0 :(得分:3)
在安装要测试的组件时,为防止错误消息在控制台中显示,请将sync
选项的false传递给mount
函数。另请参见https://vue-test-utils.vuejs.org/api/options.html#sync