我正在使用 Quasar/Vue 构建一个应用程序。我将“组织”对象传递给组件
\n<q-tab-panel name="roles">\n <OrganisationRolesTab :organisation="organisation"></OrganisationRolesTab>\n</q-tab-panel>\nRun Code Online (Sandbox Code Playgroud)\n在 OrganizationRolesTab.vue 内部,我通过 DefineProps 通用符号定义了 prop“组织”:
\n<template>\n {{ organisation }}\n</template>\n\n<script setup lang="ts">\nimport { IOrganisation } from \'src/interfaces/IOrganisation\'\n\ndefineProps<{ organisation: IOrganisation | false }>()\n</script>\nRun Code Online (Sandbox Code Playgroud)\nI 组织是:
\nexport interface IOrganisation {\n id?: string\n title: string\n shortTitle: string\n createdAt?: Date\n updatedAt?: Date\n}\nRun Code Online (Sandbox Code Playgroud)\n这在控制台中向我发出警告:
\nruntime-core.esm-bundler.js?f781:38 [Vue warn]: Invalid prop: type check failed for prop "organisation". Expected Null | Boolean, got Object \n at <OrganisationRolesTab organisation= {id: \'94de89d3-38f2-4410-bf86-74db781b18aa\', createdAt: \'2022-06-13T15:11:45.185Z\', updatedAt: \'2022-07-03T14:24:26.103Z\', …Run Code Online (Sandbox Code Playgroud)