-2
I have a solution for you.
<div id="app">
<input type="text" placeholder="type something" v-model.trim="text" @blur="blur">
<span v-show="text === ''">Please Fill the input</span>
</div>
new Vue({
el: "#app",
data: {
text: null
},
methods: {
blur() {
if(this.text === null) {
this.text = ''
}
}
}
})
The answer it is simplified to understand the logic.Once you do,you can solve your problem by replacing some code.Take a look to the demo
Source:stackexchange.com