[Vuejs]-Binding v-model from of child component to its parent

0👍

You are using wrong value "inputValue" in v-model. It would be "value". So your input will take the prop "value" as v-model and modify that directly.

Your child component would be:

<template>
  <input type="text" v-model="value" />
</template>

<script lang="ts">
export default {
  name: “BaseTextBox",
  props: {
    value: {
      type: String,
      default: "",
    },
  },
};
</script>

Leave a comment