| 123456789101112131415161718192021222324252627282930313233343536 |
- <template lang="pug">
- .form-input
- h3 {{ question.response_key_category }}
- p {{ question.response_key_prompt }}
- input(placeholder='i am a little teapot' type='text' v-model='input')
- w-button.ma1.grow(@click='handleSubmit') NEXT
- </template>
- <script>
- export default {
- name: 'FormInput',
- props: {
- question: {
- required: true,
- type: Object,
- },
- },
- emits: ['update-answers'],
- data: () => ({
- input: null,
- }),
- methods: {
- handleSubmit() {
- if(this.question.response_key_prompt === 'password') {
- this.$emit('update-answers') // no password collection
- return
- }
-
- let payload = {
- question: this.question,
- answer: this.input,
- }
- this.$emit('update-answers', payload)
- },
- },
- }
- </script>
|