index.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. var component_1 = require('../common/component');
  4. var link_1 = require('../mixins/link');
  5. var button_1 = require('../mixins/button');
  6. var open_type_1 = require('../mixins/open-type');
  7. component_1.VantComponent({
  8. mixins: [link_1.link, button_1.button, open_type_1.openType],
  9. relation: {
  10. type: 'ancestor',
  11. name: 'goods-action',
  12. current: 'goods-action-button',
  13. },
  14. props: {
  15. text: String,
  16. color: String,
  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 _a = this.parent.children,
  35. children = _a === void 0 ? [] : _a;
  36. var length = children.length;
  37. var index = children.indexOf(this);
  38. this.setData({
  39. isFirst: index === 0,
  40. isLast: index === length - 1,
  41. });
  42. },
  43. },
  44. });