index.js 946 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import baseComponent from '../helpers/baseComponent'
  2. import classNames from '../helpers/libs/classNames'
  3. import styleToCssString from '../helpers/libs/styleToCssString'
  4. baseComponent({
  5. properties: {
  6. prefixCls: {
  7. type: String,
  8. value: 'wux-wingblank',
  9. },
  10. size: {
  11. type: String,
  12. value: 'default',
  13. },
  14. bodyStyle: {
  15. type: [String, Object],
  16. value: '',
  17. observer(newVal) {
  18. this.setData({
  19. extStyle: styleToCssString(newVal),
  20. })
  21. },
  22. },
  23. },
  24. data: {
  25. extStyle: '',
  26. },
  27. computed: {
  28. classes: ['prefixCls, size', function(prefixCls, size) {
  29. const wrap = classNames(prefixCls, {
  30. [`${prefixCls}--${size}`]: size,
  31. })
  32. return {
  33. wrap,
  34. }
  35. }],
  36. },
  37. })