index.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 button_1 = require("../mixins/button");
  6. var link_1 = require("../mixins/link");
  7. (0, component_1.VantComponent)({
  8. mixins: [link_1.link, button_1.button],
  9. relation: (0, relation_1.useParent)('goods-action'),
  10. props: {
  11. text: String,
  12. color: String,
  13. size: {
  14. type: String,
  15. value: 'normal',
  16. },
  17. loading: Boolean,
  18. disabled: Boolean,
  19. plain: Boolean,
  20. type: {
  21. type: String,
  22. value: 'danger',
  23. },
  24. },
  25. methods: {
  26. onClick: function (event) {
  27. this.$emit('click', event.detail);
  28. this.jumpLink();
  29. },
  30. updateStyle: function () {
  31. if (this.parent == null) {
  32. return;
  33. }
  34. var index = this.index;
  35. var _a = this.parent.children, children = _a === void 0 ? [] : _a;
  36. this.setData({
  37. isFirst: index === 0,
  38. isLast: index === children.length - 1,
  39. });
  40. },
  41. },
  42. });