Topic: Vue js - v-model problem
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
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);
}
}
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
Felex answered 4 years ago
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- User: 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