skeleton.wxs 815 B

123456789101112131415161718192021222324252627282930
  1. var getStyle = function (object) {
  2. var styleList = [];
  3. if (object.width) {
  4. styleList.push('width:' + object.width);
  5. }
  6. styleList.push(object.height ? 'height:' + object.height : 'height:16px');
  7. if (object.background) {
  8. styleList.push('background:' + object.background);
  9. }
  10. if (object.backgroundColor) {
  11. styleList.push('background-color:' + object.backgroundColor);
  12. }
  13. if (object.margin) {
  14. styleList.push('margin:' + object.margin);
  15. }
  16. if (object.marginRight) {
  17. styleList.push('margin-right:' + object.marginRight);
  18. }
  19. if (object.marginLeft) {
  20. styleList.push('margin-left:' + object.marginLeft);
  21. }
  22. if (object.borderRadius) {
  23. styleList.push('border-radius:' + object.borderRadius);
  24. }
  25. return styleList.join(';');
  26. };
  27. module.exports = {
  28. getStyle: getStyle,
  29. };