我有一个安装在刀片/拉拉上的Vue3应用程序。在一个叶片模板中,我有一个Vue3组件(zest-下拉区域),在其中插入一个插槽:
<template>
...
<slot name="hits" :button-label="buttonLabel" :files="files" :type="type" :state="state"></slot>
</template>
<script>
...
</script>在刀片模板中,我有以下内容:
<zest-dropzone
accepted-files=".psd,application/pdf,audio/*,image/*,video/*"
button-label="{{ Lang::get('admin/button.edit') }}"
categories="{{ json_encode($categories) }}"
type="files">
<template #hits="hitsProps">
@{{ hitsProps.type }}
<zest-dropzone-files-preview :hitsProps="hitsProps" :button-label="buttonLabel" :files="files" :type="type" :state="state"></zest-dropzone-files-preview>
</template>
</zest-dropzone>ZestDropzoneFilesPreview是另一个在全球注册的组件,技术上是在页面上呈现的,但是无论我尝试什么,道具都不会出现。
在刀片模板中,@{{ hitsProps.type }正确呈现,值类型存在于hitsProps上,但是当我试图将其传递到下一个组件时,它不会出现,并且在ZestDropzoneFilesPreview中未定义。
有人知道怎么处理这事吗?谢谢。
发布于 2022-05-02 08:37:07
修正了它,道具没有相应地通过(hitsProps ->点击-道具)。
https://stackoverflow.com/questions/72084094
复制相似问题