index.wxs 564B

123456789101112131415161718192021222324252627
  1. /* eslint-disable */
  2. var style = require('../wxs/style.wxs');
  3. var addUnit = require('../wxs/add-unit.wxs');
  4. function rootStyle(data) {
  5. var currentColor = data.checked ? data.activeColor : data.inactiveColor;
  6. return style({
  7. 'font-size': addUnit(data.size),
  8. 'background-color': currentColor,
  9. });
  10. }
  11. var BLUE = '#1989fa';
  12. var GRAY_DARK = '#969799';
  13. function loadingColor(data) {
  14. return data.checked
  15. ? data.activeColor || BLUE
  16. : data.inactiveColor || GRAY_DARK;
  17. }
  18. module.exports = {
  19. rootStyle: rootStyle,
  20. loadingColor: loadingColor,
  21. };