Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

FormInput.vue 3.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template lang="pug">
  2. .form-input
  3. h3(v-if='question.response_key_prompt == "name"') Welcome to Siimee Onboarding! Let's get started!
  4. span(v-if='question.response_key_prompt == "name"') What's your name?:
  5. input(v-if='question.response_key_prompt == "name"' placeholder='Jon Doe' type='text' v-model='input')
  6. span(v-if='question.response_key_prompt == "email"') In order for you to reach out to others on siimee, we'll need an email address. Where can we best reach you?:
  7. input(v-if='question.response_key_prompt == "email"' placeholder=' @ . ' type='text' v-model='input')
  8. span(v-if='question.response_key_prompt == "password"') Next we'll need you to establish a super secret password.
  9. div Your password should be at least 10 characters long and have at
  10. least 2 special characters.
  11. div Please enter your:
  12. input(v-if='question.response_key_prompt == "password"' placeholder='supersEcre+passw0rd' type='text' v-model='input')
  13. span(v-if='question.response_key_prompt == "zipcode"') Password looks good! You're doing great.
  14. div The next piece of info we'll need is your zip code. That way we can be sure to only show you other people in your area.
  15. div What's your zip code?:
  16. input(v-if='question.response_key_prompt == "zipcode"' placeholder='99999' type='text' v-model='input')
  17. span(v-if='question.response_key_prompt == "blurb"')
  18. div Please provide us with a short blurb about yourself. What's your backstory?:
  19. textarea(v-if='question.response_key_prompt == "blurb"' placeholder='My Origin Story starts off like this...' type='text' v-model='input' rows='4' cols='50')
  20. p(v-if='question.response_key_prompt == "image"') Hey, you're almost done!
  21. p Please provide an image of yourself so others can recognize you if you ever meet up IRL:
  22. w-button.ma1.grow(@click='submitImage') Upload Image
  23. w-button.ma1.grow(@click='handleSubmit') NEXT
  24. </template>
  25. <script>
  26. export default {
  27. name: 'FormInput',
  28. props: {
  29. question: {
  30. required: true,
  31. type: Object,
  32. },
  33. },
  34. emits: ['update-answers'],
  35. data: () => ({
  36. input: null,
  37. }),
  38. methods: {
  39. handleSubmit() {
  40. if (this.question.response_key_prompt === 'password') {
  41. this.$emit('update-answers') // no password collection
  42. return
  43. }
  44. let payload = {
  45. question: this.question,
  46. answer: this.input,
  47. }
  48. this.$emit('update-answers', payload)
  49. },
  50. submitImage() {
  51. let payload = {
  52. question: this.question,
  53. answer: 'placeholder for image'
  54. }
  55. this.$emit('update-answers', payload)
  56. }
  57. },
  58. }
  59. </script>
  60. <style>
  61. .form-input,
  62. input[placeholder],
  63. textarea[placeholder] {
  64. text-align: center;
  65. }
  66. input {
  67. border: 0;
  68. outline: 0;
  69. background: transparent;
  70. border-bottom: 1px solid black;
  71. }
  72. </style>