element-plus [Component] [tree] el-tree中只有一个 < template #default="{ node,data }">默认的插槽,如果要在列表之外添加一个新的布局完全做不到

wbgh16ku  于 7个月前  发布在  其他
关注(0)|答案(5)|浏览(55)

Bug Type: Component

Environment

  • Vue Version: 3.2.37
  • Element Plus Version: 2.2.26
  • Browser / OS: chrome 92.0.4515.131
  • Build Tool: Vite

Reproduction

  • el-tree

Element Plus Playground

Steps to reproduce

随便使用一个el-tree组件,这个组件只有一个默认的 <template #default="{ node,data }">插槽,希望在这个树列表外添加一段html结构,有可能展示在el-tree列表上面,也可能在下面,当没有数据的时候也可以展示出来这段结构(是否展示可以自己判断),相当于对这个tree列表的介绍文字;希望能够自由扩展,默认加载也可以启用loading效果!

What is Expected?

1、el-tree中可以多插入几个插槽,能够自由扩展,展示形式,不仅仅那个tree列表,可能还需要其它的介绍性文字等!2.点开默认可以启用loading

What is actually happening?

目前只有一个默认插槽

Additional comments

谢谢希望能支持我说的,非常感谢

xqkwcwgp

xqkwcwgp1#

希望在这个树列表外添加一段html结构,有可能展示在el-tree列表上面,也可能在下面

你好,在 tree 组件外面自定义的那些内容不属于这个组件的功能,所以我觉得不应该集成在 tree 组件中。你可以像你提供的 demo 中那样与 tree 组件组合使用。如果数据为空不想展示默认内容,你可以设置 empty-text 属性为空,或者使用 v-if 或 v-show 来控制 tree 组件是否显示。

xam8gpfp

xam8gpfp2#

为空时产品会要求不仅仅是那么几个字,是一段html布局,比如其它链接跳转等…

---原始邮件--- 发件人: ***@***.***> 发送时间: 2023年2月22日(周三) 晚上9:10 收件人: ***@***.***>; 抄送: ***@***.******@***.***>; 主题: Re: [element-plus/element-plus] [Component] [tree] el-tree中只有一个 <template #default="{ node,data }">默认的插槽,如果要在列表之外添加一个新的布局完全做不到 (Issue #11665) 希望在这个树列表外添加一段html结构,有可能展示在el-tree列表上面,也可能在下面,可以提供为空的插槽,或者其它自定义结构的插槽吗,不在循环内 你好,在 tree 组件外面自定义的那些内容不属于这个组件的功能,所以我觉得不应该集成在 tree 组件中。你可以像你提供的 demo 中那样与 tree 组件组合使用。如果数据为空不想展示默认内容,你可以设置 empty-text 属性为空,或者使用 v-if 或 v-show 来控制 tree 组件是否显示。 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: ***@***.***>

70gysomp

70gysomp3#

为空时产品会要求不仅仅是那么几个字,是一段html布局,比如其它链接跳转等

可以像上面说的那样,用 v-if 或 v-show 来控制

p5fdfcr1

p5fdfcr14#

In fact, that problems have really gone beyond the scope of components. If you need more customized content, you can consider modifying it after forking. The code extensibility of element-plus is very good, which will not be a very difficult thing

zpqajqem

zpqajqem5#

你好,最近在使用element-plus的过程中发现不兼容google低版本浏览器70,有没有什么解决办法啊?…

---原始邮件--- 发件人: ***@***.***> 发送时间: 2023年2月24日(周五) 下午3:48 收件人: ***@***.***>; 抄送: ***@***.******@***.***>; 主题: Re: [element-plus/element-plus] [Component] [tree] el-tree中只有一个 <template #default="{ node,data }">默认的插槽,如果要在列表之外添加一个新的布局完全做不到 (Issue #11665) In fact, that problems have really gone beyond the scope of components. If you need more customized content, you can consider modifying it after forking. The code extensibility of element-plus is very good, which will not be a very difficult thing — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: ***@***.***>

相关问题