Add "append" and "prepend" slots for vue-vuetify extended renderers

未关闭 适合新手
#2,668 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@simeyc 已经在做这个了。

开始于 2026年11月12日。

  • #2669 来自 @simeyc —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
75/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
frontend

调研方向

首先在 Vue Vuetify 包中找到 AutocompleteEnumControlRenderer 和 AutocompleteOneOfEnumControlRenderer,然后将它们处理 slot 的方式与其他控件渲染器进行比较。为这两个扩展渲染器添加 prepend 和 append slot,并检查 slot 内容是否以一致的格式传递到 Vuetify 底层组件。

由索引模型根据 Issue 内容生成。

描述

Is your feature request related to a problem? Please describe.

The jsonforms/vue-vuetify README states that "all control renderers now support prepend and append slots". However, these slots are missing for the extended renderers, namely AutocompleteEnumControlRenderer and AutocompleteOneOfEnumControlRenderer. This means that when using extendedVuetifyRenderers, enum controls lack the slots while others have them.

Describe the solution you'd like

Add the "prepend" and "append" slots to the extended renderers, for consistency with the others.

Describe alternatives you've considered

My current workaround is to implement a custom renderer which wraps the autocomplete renderers in a div with the slot content either side, like:

<template>
    <!-- Adds slots to the default autocomplete oneOf enum renderer. -->
    <div class="d-flex align-center">
        <div v-if="$slots.prepend" class="mr-4">
            <slot name="prepend" />
        </div>
        <AutocompleteEnumControlRenderer class="flex-fill" v-bind="props" />
        <div v-if="$slots.append" class="ml-4">
            <slot name="append" />
        </div>
    </div>
</template>

<script setup lang="ts">
import { type RendererProps } from '@jsonforms/vue';
import { AutocompleteEnumControlRenderer } from '@jsonforms/vue-vuetify';

const props = defineProps<RendererProps>();
</script>

However, this doesn't actually pass the slot content to the underlying Vuetify components (v-select/v-autocomplete), so it's a bit of a hack and formatting is off.

Package

Vue Vuetify Renderers

Additional context

I intend to push a PR for this shortly.

主要语言
TypeScript
星标
2.8k
派生
423
平均合并
5 天 16 小时
30 天内合并 PR
9

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

eclipsesource/jsonforms 的其他 Issue

查看 eclipsesource/jsonforms 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。