options.js 424 B

12345678910111213141516171819
  1. "use strict";
  2. var _component = require("../common/component");
  3. (0, _component.VantComponent)({
  4. props: {
  5. options: Array,
  6. showBorder: Boolean
  7. },
  8. methods: {
  9. onSelect: function onSelect(event) {
  10. var index = event.currentTarget.dataset.index;
  11. var option = this.data.options[index];
  12. this.$emit("select", Object.assign(Object.assign({}, option), {
  13. index: index
  14. }));
  15. }
  16. }
  17. });