在我们的代码库中有一个函数:
userCanUploadAttachment() {
if (this.manualFileUploadIsActive) {
if (!this.contact.attachment) {
if (this.permission('canUploadAttachments')) {
return true;
}
}
}
return false;
},
只有一个地方可以调用计算属性,就在此位置:
<b-button
v-if="userCanUploadAttachment"
class="btn-lg pull-right hide-when-printing"
@click="uploadAttachment(contact.id)"
>
这是整个文件中调用userCanUploadAttachment
的仅有两个位置。为什么要找二传手?消息:
[Vue warn]: Computed property "userCanViewAttachment" was assigned to but it has no setter.
通常,如果您将其设置在某个地方,但未将其设置在任何地方?