首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >叶片模板内的Vue槽道具

叶片模板内的Vue槽道具
EN

Stack Overflow用户
提问于 2022-05-02 08:24:32
回答 1查看 279关注 0票数 0

我有一个安装在刀片/拉拉上的Vue3应用程序。在一个叶片模板中,我有一个Vue3组件(zest-下拉区域),在其中插入一个插槽:

代码语言:javascript
复制
<template>
...

<slot name="hits" :button-label="buttonLabel" :files="files" :type="type" :state="state"></slot>
</template>

<script>
...
</script>

在刀片模板中,我有以下内容:

代码语言:javascript
复制
<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中未定义。

有人知道怎么处理这事吗?谢谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-05-02 08:37:07

修正了它,道具没有相应地通过(hitsProps ->点击-道具)。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72084094

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档