邃芒智像相册
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 

24 wiersze
649 B

  1. var utils = require('../wxs/utils.wxs');
  2. var style = require('../wxs/style.wxs');
  3. function isSelected(tab, textKey, option) {
  4. return tab.selected && tab.selected[textKey] === option[textKey]
  5. }
  6. function optionClass(tab, textKey, option) {
  7. return utils.bem('cascader__option', { selected: isSelected({ tab, textKey, option }), disabled: option.disabled })
  8. }
  9. function optionStyle(data) {
  10. var color = data.option.color || (isSelected(data.tab, data.textKey, data.option) ? data.activeColor : undefined);
  11. return style({
  12. color
  13. });
  14. }
  15. module.exports = {
  16. isSelected: isSelected,
  17. optionClass: optionClass,
  18. optionStyle: optionStyle,
  19. };