Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

monthCellContentRender and cellContentRender not working #4394

Closed
codingfishman opened this issue Dec 28, 2016 · 5 comments
Closed

monthCellContentRender and cellContentRender not working #4394

codingfishman opened this issue Dec 28, 2016 · 5 comments
Assignees
Labels
🐛 Bug Ant Design Team had proved that this is a bug.

Comments

@codingfishman
Copy link

codingfishman commented Dec 28, 2016

发生问题的环境是:

  • antd 版本: 2.5.1
  • 操作系统及其版本: macOs Serria
  • 浏览器及其版本: Chrome 55

您做了什么?请提供尽可能详细的重现步骤。

使用 MonthPicker并且指定了 monthCellContentRendercellContentRender,期望改变MonthPicker生成的节点内容

您期待的结果是:

节点内容被改变

实际上的结果是:

两个属性无效。 看到代码中在调用rc-calendar的MonthCalendar时,自己有包装一层Props,而且编译后的代码也只向 MonthCalendar传入了自己包装过的props,MonthCalendar自己的props,比如 monthCellContentRender 没有被传入,是不是这一步导致该属性被忽略了。

可重现的在线演示

http://codepen.io/anon/pen/pNMozv?editors=001#anon-login
可打开控制台查看,发现函数并未执行。

@benjycui benjycui added the 🐛 Bug Ant Design Team had proved that this is a bug. label Dec 29, 2016
@benjycui
Copy link
Contributor

这儿没有把 monthCellContentRender 之类传下去 https://github.com/ant-design/ant-design/blob/master/components/date-picker/createPicker.tsx#L121-L136

有兴趣 PR 个么?

@afc163 afc163 self-assigned this Dec 30, 2016
@afc163 afc163 closed this as completed in c3982b0 Dec 30, 2016
@afc163
Copy link
Member

afc163 commented Dec 30, 2016

cellContentRender 是个文档错误。

monthCellContentRender 确实有问题,上面的提交已修复,感谢反馈。

@chuhanan
Copy link

节点内容改变了,怎么让节点内容显示在 input 框内呢 ? 比如现在是 9 月, 我在使用 MonthPicker 的时候如果是 9月节点内容显示成了 至今, 我想把至今这个放在 输入框内,但是现在 输入框只支持 moment 类型, 可以处理吗 ? thx!

@chuhanan
Copy link

@afc163

@benjycui
Copy link
Contributor

我想把至今这个放在 输入框内,但是现在 输入框只支持 moment 类型, 可以处理吗 ? thx!

目前无法处理,也没有想到好的解决办法。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Ant Design Team had proved that this is a bug.
Projects
None yet
Development

No branches or pull requests

4 participants