From 518b852e8bd9c50a6c5c7e84cddecb5c94ebb5b6 Mon Sep 17 00:00:00 2001 From: MG12 Date: Sat, 12 Dec 2015 20:34:00 +0800 Subject: add new options about disabled time --- src/module/Select.jsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/module/Select.jsx') diff --git a/src/module/Select.jsx b/src/module/Select.jsx index 3659692..ab10789 100644 --- a/src/module/Select.jsx +++ b/src/module/Select.jsx @@ -51,11 +51,15 @@ const Select = React.createClass({ getOptions() { const { options, selectedIndex, prefixCls } = this.props; return options.map((item, index) => { - const selected = selectedIndex === index; const cls = classnames({ - [`${prefixCls}-select-option-selected`]: selected, + [`${prefixCls}-select-option-selected`]: selectedIndex === index, + [`${prefixCls}-select-option-disabled`]: item.disabled, }); - return
  • {item}
  • ; + let onclick = null; + if (!item.disabled) { + onclick = this.onSelect.bind(this, +item.value); + } + return
  • {item.value}
  • ; }); }, -- cgit v1.2.3