Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

FormDropdown.vue 981B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <template lang="pug">
  2. .role
  3. h3 {{ question.response_key_category }}
  4. p {{ question.response_key_prompt }}
  5. w-select.mt4(:items='items' placeholder='i am' v-model='selection')
  6. w-button.ma1.grow(@click='handleSubmit') NEXT
  7. </template>
  8. <script>
  9. export default {
  10. name: 'FormDropdown',
  11. props: {
  12. question: {
  13. required: true,
  14. type: Object,
  15. },
  16. },
  17. emits: ['update-answers'],
  18. data: () => ({
  19. selection: null,
  20. }),
  21. computed: {
  22. items() {
  23. return this.question.responses.map(res => ({ label: res }))
  24. },
  25. },
  26. methods: {
  27. handleSubmit() {
  28. if (!this.selection) {
  29. console.warn('Please select a role.')
  30. return
  31. }
  32. let payload = {
  33. question: this.question,
  34. answer: this.selection,
  35. }
  36. this.$emit('update-answers', payload)
  37. },
  38. },
  39. }
  40. </script>