index.wxs 677B

12345678910111213141516171819202122232425262728293031323334
  1. /* eslint-disable */
  2. var style = require('../wxs/style.wxs');
  3. var addUnit = require('../wxs/add-unit.wxs');
  4. function iconStyle(data) {
  5. var styles = {
  6. 'font-size': addUnit(data.iconSize),
  7. };
  8. if (
  9. data.checkedColor &&
  10. !(data.disabled || data.parentDisabled) &&
  11. data.value === data.name
  12. ) {
  13. styles['border-color'] = data.checkedColor;
  14. styles['background-color'] = data.checkedColor;
  15. }
  16. return style(styles);
  17. }
  18. function iconCustomStyle(data) {
  19. return style({
  20. 'line-height': addUnit(data.iconSize),
  21. 'font-size': '.8em',
  22. display: 'block',
  23. });
  24. }
  25. module.exports = {
  26. iconStyle: iconStyle,
  27. iconCustomStyle: iconCustomStyle,
  28. };