index.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var component_1 = require("../common/component");
  4. var relation_1 = require("../common/relation");
  5. var link_1 = require("../mixins/link");
  6. (0, component_1.VantComponent)({
  7. relation: (0, relation_1.useParent)('grid'),
  8. classes: ['content-class', 'icon-class', 'text-class'],
  9. mixins: [link_1.link],
  10. props: {
  11. icon: String,
  12. iconColor: String,
  13. iconPrefix: {
  14. type: String,
  15. value: 'van-icon',
  16. },
  17. dot: Boolean,
  18. info: null,
  19. badge: null,
  20. text: String,
  21. useSlot: Boolean,
  22. },
  23. data: {
  24. viewStyle: '',
  25. },
  26. mounted: function () {
  27. this.updateStyle();
  28. },
  29. methods: {
  30. updateStyle: function () {
  31. if (!this.parent) {
  32. return;
  33. }
  34. var _a = this.parent, data = _a.data, children = _a.children;
  35. var columnNum = data.columnNum, border = data.border, square = data.square, gutter = data.gutter, clickable = data.clickable, center = data.center, direction = data.direction, reverse = data.reverse, iconSize = data.iconSize;
  36. this.setData({
  37. center: center,
  38. border: border,
  39. square: square,
  40. gutter: gutter,
  41. clickable: clickable,
  42. direction: direction,
  43. reverse: reverse,
  44. iconSize: iconSize,
  45. index: children.indexOf(this),
  46. columnNum: columnNum,
  47. });
  48. },
  49. onClick: function () {
  50. this.$emit('click');
  51. this.jumpLink();
  52. },
  53. },
  54. });