index.js 867 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import { VantComponent } from '../common/component';
  2. VantComponent({
  3. classes: ['avatar-class', 'title-class', 'row-class'],
  4. props: {
  5. row: {
  6. type: Number,
  7. value: 0,
  8. observer(value) {
  9. this.setData({ rowArray: Array.from({ length: value }) });
  10. },
  11. },
  12. title: Boolean,
  13. avatar: Boolean,
  14. loading: {
  15. type: Boolean,
  16. value: true,
  17. },
  18. animate: {
  19. type: Boolean,
  20. value: true,
  21. },
  22. avatarSize: {
  23. type: String,
  24. value: '32px',
  25. },
  26. avatarShape: {
  27. type: String,
  28. value: 'round',
  29. },
  30. titleWidth: {
  31. type: String,
  32. value: '40%',
  33. },
  34. rowWidth: {
  35. type: null,
  36. value: '100%',
  37. observer(val) {
  38. this.setData({ isArray: val instanceof Array });
  39. },
  40. },
  41. },
  42. data: {
  43. isArray: false,
  44. rowArray: [],
  45. },
  46. });