the code is as follows
<template>
<div id="data">
<input type="text" v-model="obj.name" placeholder="">
<button @click="commit"></button>
<span id="show-name">{{obj.name}}</span>
</div>
</template>
<script>
export default {
data(){
return{
obj:{
name:""
}
}
},
methods:{
commit(){
console.log(this.obj, this.obj.name)
}
}
}
</script>
the final result returned is
what should I do if the result is {name: "sdf"}?