index.js 1.1KB

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