Cristiano Magro
2025-01-08 79dfa2cf60feebd3e205d2992167b61171d7a47d
v-model su number

modificatori e stringa
1 files modified
9 ■■■■ changed files
11 - Forms/xno-forms-01-starting-setup/src/components/TheForm.vue 9 ●●●● patch | view | raw | blame | history
11 - Forms/xno-forms-01-starting-setup/src/components/TheForm.vue
@@ -6,7 +6,7 @@
    </div>
    <div class="form-control">
      <label for="age">Your Age (Years)</label>
      <input id="age" name="age" type="number" />
      <input id="age" name="age" type="number" v-model="userAge" ref="inputAge"/>
    </div>
    <div class="form-control">
      <label for="referrer">How did you hear about us?</label>
@@ -57,12 +57,19 @@
  data() {
    return {
      userName: '',
      userAge: null,
    }
  },
  methods: {
    submitForm() {
      console.log('Username: ' + this.userName );
      this.userName = '';
      console.log('User age: '); // + this.userName);
      console.log(this.userAge);
      console.log(this.$refs.inputAge.value);
      console.log(18); // + this.userName);
      this.userAge = null;
     }
  }