options.js 884 B

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