作者:baiyanan862273 | 来源:互联网 | 2022-11-27 10:39
我试图按照此处列出的配置在我的测试中禁止显示警告:https : //vue-test-utils.vuejs.org/api/config.html#silent,如下所示:
import { config } from '@vue/test-utils';
// this should actually be the default but the default is not working
config.silent = true;
但是,我仍然在测试结果中看到警告:
TheQueue
? should show the queue bar if there are items queued
? should show the correct count of queued items in queued bar
[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: "mdTemplateData"
found in
--->
at src/components/the-queue/TheQueue.vue
值得注意的是,我在正常使用该应用程序时未看到此错误。这只会在测试中弹出(否则我将尝试修复实际的建议问题)。
我在这里做错了什么,为什么我不能抑制这些警告?还是我误会了silent
应该做什么?