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

FormInput.vue 903B

123456789101112131415161718192021222324252627282930313233343536
  1. <template lang="pug">
  2. .form-input
  3. h3 {{ question.response_key_category }}
  4. p {{ question.response_key_prompt }}
  5. input(placeholder='i am a little teapot' type='text' v-model='input')
  6. w-button.ma1.grow(@click='handleSubmit') NEXT
  7. </template>
  8. <script>
  9. export default {
  10. name: 'FormInput',
  11. props: {
  12. question: {
  13. required: true,
  14. type: Object,
  15. },
  16. },
  17. emits: ['update-answers'],
  18. data: () => ({
  19. input: null,
  20. }),
  21. methods: {
  22. handleSubmit() {
  23. if(this.question.response_key_prompt === 'password') {
  24. this.$emit('update-answers') // no password collection
  25. return
  26. }
  27. let payload = {
  28. question: this.question,
  29. answer: this.input,
  30. }
  31. this.$emit('update-answers', payload)
  32. },
  33. },
  34. }
  35. </script>