I am new to Vue and have learned v-model directive.
To test what v-model.trim does I wrote the following code.
<template>
<p>Hello {{ myName }}</p>
<form>Name: <input type="text" v-model.trim="myName"/></form>
</template>
<script>
export default {
data(){
return{
myName: "",
};
},
};
</script>
When I typed in " B o b" the output was "B o b". However, I found out that even when I don't use v-model.trim and just use v-model as follows
<template>
<p>Hello {{ myName }}</p>
<form>Name: <input type="text" v-model="myName"/></form>
</template>
<script>
export default {
data(){
return{
myName: "",
};
},
};
</script>
it gives the exact same output.
What is the purpose of .trim?