Coder Social home page Coder Social logo

Comments (9)

linxianxi avatar linxianxi commented on May 19, 2024 1

tagRender 是有返回 onClose 属性的,可以直接用

大哥,onXXX 都是事件回调

tagRender={({ onClose }) =>  <Tag onClose={onClose} />}

from ant-design.

zombieJ avatar zombieJ commented on May 19, 2024

迭代 这个指的是什么?不好意思,我不太明白说的是啥。。。

from ant-design.

hans000 avatar hans000 commented on May 19, 2024

抱歉,我意思是labelRender的api设计应该和maxTagPlaceholder类似才对吧(多选模式下),label应该指整体,而不是单个tag,现在提供的labelRender 相当于map的迭代器 { values.map(value => labelRender(value )) }

其实我感觉应该是这样的{ labelRender(values) }

我考虑先使用maxTagCount=0 然后使用maxTagPlaceholder来实现吧

from ant-design.

afc163 avatar afc163 commented on May 19, 2024

What does the proposed API look like?

完整的 API 描述一下。

from ant-design.

hans000 avatar hans000 commented on May 19, 2024

What does the proposed API look like?

完整的 API 描述一下。

后来我想到maxTagCount + maxTagPlaceholder 也能实现,就先这样吧

from ant-design.

hans000 avatar hans000 commented on May 19, 2024

但其实还有一些别的问题是
我感觉 labelRender的api应该是

labelRender -> (option: OptionType | OptionType[], defaultDom: ReactElement| ReactElement[]) => ReactElement

然后tagRender应该把action remove 做参数也返回,不然需要自己去做受控,实际使用有点麻烦

tagRender -> (props: CustomTagProps, index, remove) => ReactElement

from ant-design.

linxianxi avatar linxianxi commented on May 19, 2024

tagRender 是有返回 onClose 属性的,可以直接用

from ant-design.

hans000 avatar hans000 commented on May 19, 2024

tagRender 是有返回 onClose 属性的,可以直接用

大哥,onXXX 都是事件回调

from ant-design.

MadCcc avatar MadCcc commented on May 19, 2024

看起来都是可以通过代码实现的功能,没其他问题先关闭了

from ant-design.

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.