这个警告一般是因为在Vue组件中,给组件传递了没有在组件props中声明的属性。这可能会导致意外行为,因为这些属性并不会被组件自动接收。
<your-component v-bind:data="data"></your-component>
只需要在子组件中定义并接受父组件传来的参数,即可解决警告~
import { defineProps } from "vue";
const props = defineProps({
data: {
type: Object,
default: {},
},
});