Giter Club home page Giter Club logo

Comments (7)

wzc520pyfm avatar wzc520pyfm commented on June 2, 2024 1

首先你的demo代码存在错误,这个自己研究。

是指运算优先级问题吧,抱歉,在复现代码中出现了这样的错误(

建这个 issue 起源于我想替换掉单选模式下 el-select 展示的选中的值。tag 插槽出现之前,el-select 只能通过 prefix 插槽去改变显示。然而,在我的印象中,el-select 的 prefix 的样式是不正确的,而且这个问题许久没有处理(见 #10644),所以对新的 tag 插槽抱有期待。

现在,我能理解 tag 只适用于多选模式这一设计。请问除了 prefix 或者 tag 有没有更合适的方法去修改 el-select 中的内容呢

The styling issue with the prefix has been fixed in version 2.5.0. Can the custom template meet your requirements?

from element-plus.

chenxch avatar chenxch commented on June 2, 2024 1

当然最好的方法是新增插槽,但是没这么快哦。
新增插槽可能还需要考虑是否要把tag插槽收敛进去之类的。

from element-plus.

chenxch avatar chenxch commented on June 2, 2024

首先你的demo代码存在错误,这个自己研究。其次本身tag功能就是为多选设计的,用于隔开选项,单选tag不是多此一举?

from element-plus.

kooriookami avatar kooriookami commented on June 2, 2024

Tag插槽只对多选模式生效。

from element-plus.

Lionad-Morotar avatar Lionad-Morotar commented on June 2, 2024

首先你的demo代码存在错误,这个自己研究。

是指运算优先级问题吧,抱歉,在复现代码中出现了这样的错误(

建这个 issue 起源于我想替换掉单选模式下 el-select 展示的选中的值。tag 插槽出现之前,el-select 只能通过 prefix 插槽去改变显示。然而,在我的印象中,el-select 的 prefix 的样式是不正确的,而且这个问题许久没有处理(见 #10644),所以对新的 tag 插槽抱有期待。

现在,我能理解 tag 只适用于多选模式这一设计。请问除了 prefix 或者 tag 有没有更合适的方法去修改 el-select 中的内容呢

from element-plus.

chenxch avatar chenxch commented on June 2, 2024

手动画一个select框,把el-select隐藏起来,这样结果的渲染就都可以自己处理了。

from element-plus.

Lionad-Morotar avatar Lionad-Morotar commented on June 2, 2024

手动画一个select框,把el-select隐藏起来,这样结果的渲染就都可以自己处理了。

这能解决问题,但不是一个合适的方法。也许应该给 ElSelect 新增一个插槽来表示“选中”的内容?

对用户和开发者而言,Select 是选中内容而不是字符输入,这是符合直觉的,所以既然 Option 可以自定义的话,Select 所选中的内容也应该可以自定义。

from element-plus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.