index.js 1.0 KB

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