Topic: Vue js - v-model problem
                  
                  SirComix
                  pro
                  asked 6 years ago
                
Hello,
when i bind some variable to mdb input, it doesn't show.
Please there is some option you will repair it ?
Thank you for your answer
                      
                      Mikołaj Smoleński
                      staff
                        answered 6 years ago
                    
Since the next release You'll be able to use v-model also instead of @input event.
Here's the example:
<mdb-input type="text" label="Basic example" v-model="test" />
data() {
return {
test: 'Test'
};
},
watch: {
test() {
console.log(this.test);
}
}
Best Regards
                      
                      Mikołaj Smoleński
                      staff
                        answered 6 years ago
                    
Hi there,
Currently You're able to set input's value by adding attribute 'value' to it. Also You can get dynamically changed value using '@input' event. Here's the example code:
<mdb-input type="text" label="Basic example" value="Example value" @input="handleInput"/>
...
methods: {
 handleInput (val) {
  console.log(val);
 }
}
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- ForumUser: Pro
 - Premium support: No
 - Technology: MDB Vue
 - MDB Version: 4.8.2
 - Device: PC
 - Browser: Firefox
 - OS: Ubuntu 18.10
 - Provided sample code: No
 - Provided link: No