index.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. 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,
  35. data = _a.data,
  36. children = _a.children;
  37. var columnNum = data.columnNum,
  38. border = data.border,
  39. square = data.square,
  40. gutter = data.gutter,
  41. clickable = data.clickable,
  42. center = data.center,
  43. direction = data.direction,
  44. reverse = data.reverse,
  45. iconSize = data.iconSize;
  46. this.setData({
  47. center: center,
  48. border: border,
  49. square: square,
  50. gutter: gutter,
  51. clickable: clickable,
  52. direction: direction,
  53. reverse: reverse,
  54. iconSize: iconSize,
  55. index: children.indexOf(this),
  56. columnNum: columnNum,
  57. });
  58. },
  59. onClick: function () {
  60. this.$emit('click');
  61. this.jumpLink();
  62. },
  63. },
  64. });