InputSelect.vue 682 B

12345678910111213141516171819202122232425262728293031323334
  1. <template lang="pug">
  2. div
  3. select.input-select(@change='onSelect')
  4. option(
  5. v-for='o in options'
  6. :value='o.id'
  7. ) {{ o.name }}
  8. </template>
  9. <script>
  10. export default {
  11. props: {
  12. selected: {
  13. type: Object,
  14. default: ''
  15. },
  16. options: {
  17. type: Array,
  18. default: []
  19. }
  20. },
  21. methods: {
  22. onSelect(e) {
  23. this.$emit('onSelect', e.target.value)
  24. }
  25. }
  26. }
  27. </script>
  28. <style lang="sass">
  29. .input-select
  30. width: 100%
  31. height: 35px
  32. </style>