options.js 404B

123456789101112131415
  1. import { VantComponent } from '../common/component';
  2. VantComponent({
  3. props: {
  4. options: Array,
  5. showBorder: Boolean,
  6. },
  7. methods: {
  8. onSelect(event) {
  9. const { index } = event.currentTarget.dataset;
  10. const option = this.data.options[index];
  11. this.$emit('select', Object.assign(Object.assign({}, option), { index }));
  12. },
  13. },
  14. });