index.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. customStyle: {
  25. type: String,
  26. value: '',
  27. },
  28. },
  29. methods: {
  30. onClick: function (event) {
  31. this.$emit('click', event.detail);
  32. this.jumpLink();
  33. },
  34. updateStyle: function () {
  35. if (this.parent == null) {
  36. return;
  37. }
  38. var index = this.index;
  39. var _a = this.parent.children, children = _a === void 0 ? [] : _a;
  40. this.setData({
  41. isFirst: index === 0,
  42. isLast: index === children.length - 1,
  43. });
  44. },
  45. },
  46. });