储能智慧云小程序
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

cell-group.js 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
  2. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  3. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  4. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  5. return c > 3 && r && Object.defineProperty(target, key, r), r;
  6. };
  7. import { SuperComponent, wxComponent } from '../common/src/index';
  8. import config from '../common/config';
  9. import props from './props';
  10. const { prefix } = config;
  11. const name = `${prefix}-cell-group`;
  12. let CellGroup = class CellGroup extends SuperComponent {
  13. constructor() {
  14. super(...arguments);
  15. this.externalClasses = [`${prefix}-class`, `${prefix}-class-title`];
  16. this.relations = {
  17. '../cell/cell': {
  18. type: 'child',
  19. },
  20. };
  21. this.properties = props;
  22. this.data = {
  23. prefix,
  24. classPrefix: name,
  25. };
  26. this.lifetimes = {
  27. ready() {
  28. this.updateLastChid();
  29. },
  30. };
  31. this.methods = {
  32. updateLastChid() {
  33. const items = this.$children;
  34. items.forEach((child, index) => child.setData({ isLastChild: index === items.length - 1 }));
  35. },
  36. };
  37. }
  38. };
  39. CellGroup = __decorate([
  40. wxComponent()
  41. ], CellGroup);
  42. export default CellGroup;