index.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. component_1.VantComponent({
  7. relation: 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. dot: Boolean,
  14. info: null,
  15. badge: null,
  16. text: String,
  17. useSlot: Boolean,
  18. },
  19. data: {
  20. viewStyle: '',
  21. },
  22. mounted: function () {
  23. this.updateStyle();
  24. },
  25. methods: {
  26. updateStyle: function () {
  27. if (!this.parent) {
  28. return;
  29. }
  30. var _a = this.parent,
  31. data = _a.data,
  32. children = _a.children;
  33. var columnNum = data.columnNum,
  34. border = data.border,
  35. square = data.square,
  36. gutter = data.gutter,
  37. clickable = data.clickable,
  38. center = data.center,
  39. direction = data.direction,
  40. iconSize = data.iconSize;
  41. this.setData({
  42. center: center,
  43. border: border,
  44. square: square,
  45. gutter: gutter,
  46. clickable: clickable,
  47. direction: direction,
  48. iconSize: iconSize,
  49. index: children.indexOf(this),
  50. columnNum: columnNum,
  51. });
  52. },
  53. onClick: function () {
  54. this.$emit('click');
  55. this.jumpLink();
  56. },
  57. },
  58. });