options.js 850 B

12345678910111213141516171819202122232425262728293031
  1. 'use strict';
  2. var __assign =
  3. (this && this.__assign) ||
  4. function () {
  5. __assign =
  6. Object.assign ||
  7. function (t) {
  8. for (var s, i = 1, n = arguments.length; i < n; i++) {
  9. s = arguments[i];
  10. for (var p in s)
  11. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  12. }
  13. return t;
  14. };
  15. return __assign.apply(this, arguments);
  16. };
  17. Object.defineProperty(exports, '__esModule', { value: true });
  18. var component_1 = require('../common/component');
  19. component_1.VantComponent({
  20. props: {
  21. options: Array,
  22. showBorder: Boolean,
  23. },
  24. methods: {
  25. onSelect: function (event) {
  26. var index = event.currentTarget.dataset.index;
  27. var option = this.data.options[index];
  28. this.$emit('select', __assign(__assign({}, option), { index: index }));
  29. },
  30. },
  31. });