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

expose props.contentRender method(in MonthPanel.jsx & monthCalendar.jsx) #170

Merged
merged 2 commits into from Nov 1, 2016

Conversation

wufeng87
Copy link

我直接使用了monthCalendar控件用来做月份选择,需要使用contentRender方法给特定的月份加上特殊的标记,用以标识该月份是有或者没有数据。

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.5%) to 80.998% when pulling ab0d546 on wufeng87:master into 94221aa on react-component:master.

@benjycui
Copy link
Member

命名风格或者可以统一?

image

@wufeng87
Copy link
Author

好的,请问下这个表格(命名风格)在哪看得到吗?

@benjycui
Copy link
Member

看下已有的 API https://github.com/react-component/calendar

@wufeng87
Copy link
Author

还有怎么测试?没PR过,麻烦指点下。
我打算把这两个都写上

cellRender={props.monthCellRender}
contentRender={props.monthCellContentRender}

@wufeng87
Copy link
Author

恩 谢谢,看到下面的 Development文档了

@benjycui
Copy link
Member

cc @yiminghe

@wufeng87
Copy link
Author

wufeng87 commented Oct 31, 2016

有个问题,为了可以继续使用已有的样式,是不是prefixCls变量也能传过来(monthCellRender)?这是我写的测试代码

function onMonthCellRender(value, locale){
  const content = value.month();
  const prefixCls = 'rc-calendar-month-panel';
  const cellEl = (
    <a className={`${prefixCls}-month`}>
      {content}
    </a>
  );
  console.log('month-calendar onMonthCellRender', (value && value.format(format)));
  return cellEl;
}

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.5%) to 81.014% when pulling c3405c4 on wufeng87:master into 94221aa on react-component:master.

@yiminghe yiminghe merged commit 7c818e0 into react-component:master Nov 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants