index.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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-whitespace',
  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. methods: {
  38. onTap() {
  39. this.triggerEvent('click')
  40. },
  41. },
  42. })