Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

希望 JTreeSelect 组件能支持antdv 对应的a-tree-select 组件的title 插槽 #6953

Closed
YGmem opened this issue Jul 23, 2024 · 3 comments

Comments

@YGmem
Copy link

YGmem commented Jul 23, 2024

版本号:

3.4.4

问题描述:

希望 JTreeSelect 组件能支持antdv 对应的a-tree-select 组件的title 插槽

错误截图:

image

友情提示:

  • 未按格式要求发帖、描述过于简单的,会被直接删掉;
  • 描述问题请图文并茂,方便我们理解并快速定位问题;
  • 如果使用的不是master,请说明你使用的分支;
@zhangdaiscott
Copy link
Member

zy

@liaozhiyang
Copy link
Contributor

已新增,下一版本发布。

你本地可在src/components/Form/src/jeecg/components/JTreeSelect.vue 文件按如下进行修改:
image
image

<template #[name]="data" v-for="name in slotNamesGroup" :key="name">
    <slot :name="name" v-bind="data"></slot>
</template>

import { ref, watch, unref, nextTick, computed } from 'vue';
import { isObject } from '/@/utils/is';
const slots = defineSlots();


 /**
   * 2024-07-29
   * liaozhiyang
   * JTreeSelect 组件能支持antdv 对应的a-tree-select 组件的title 插槽
   */
  const slotNamesGroup = computed(() => {
    const native: string[] = [];
    if (isObject(slots)) {
      for (const name of Object.keys(slots)) {
        native.push(name);
      }
    }
    return native;
  });

使用及效果:

image

@YGmem
Copy link
Author

YGmem commented Jul 29, 2024

已新增,下一版本发布。

你本地可在src/components/Form/src/jeecg/components/JTreeSelect.vue 文件按如下进行修改: image image

<template #[name]="data" v-for="name in slotNamesGroup" :key="name">
    <slot :name="name" v-bind="data"></slot>
</template>

import { ref, watch, unref, nextTick, computed } from 'vue';
import { isObject } from '/@/utils/is';
const slots = defineSlots();


 /**
   * 2024-07-29
   * liaozhiyang
   * JTreeSelect 组件能支持antdv 对应的a-tree-select 组件的title 插槽
   */
  const slotNamesGroup = computed(() => {
    const native: string[] = [];
    if (isObject(slots)) {
      for (const name of Object.keys(slots)) {
        native.push(name);
      }
    }
    return native;
  });

使用及效果:

image

感谢

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants