diff --git a/packages/cascader/index.wxml b/packages/cascader/index.wxml index b1d724b9..5605c175 100644 --- a/packages/cascader/index.wxml +++ b/packages/cascader/index.wxml @@ -38,13 +38,13 @@ wx:for-item="option" wx:key="index" class="{{ option.className }} {{ utils.optionClass(tab, textKey, option) }}" - style="{{ utils.optionStyle({ tab, textKey, option, activeColor }) }}" + style="{{ utils.optionStyle({ tab, valueKey, option, activeColor }) }}" data-option="{{ option }}" data-tab-index="{{ tabIndex }}" bind:tap="onSelect" > {{ option[textKey] }} - + diff --git a/packages/cascader/index.wxs b/packages/cascader/index.wxs index cba6465c..215c4ad8 100644 --- a/packages/cascader/index.wxs +++ b/packages/cascader/index.wxs @@ -10,7 +10,7 @@ function optionClass(tab, textKey, option) { } function optionStyle(data) { - var color = data.option.color || (isSelected(data.tab, data.textKey, data.option) ? data.activeColor : undefined); + var color = data.option.color || (isSelected(data.tab, data.valueKey, data.option) ? data.activeColor : undefined); return style({ color });