How to get suffix value from <q-input>?
-
I want to get @gmail.com suffix for my console.log(), how can i do it?
Many thanks.
-
Untested, but should work:
<template> <q-input type="email" v-model="email" float-label="Email" :suffix="suffix" clearable /> </template> <script> export default { data () { return { email: '', suffix: '@gmail.com' } }, methods: { login: function (event) { console.log(this.email + this.suffix + ':' + this.password) } } } </script>
Vue.js is data-centric, so it makes sense to define your settings in data() and bind to them. On top of that, you get reactivity out of the box and your suffix is dynamic.
-
yes, it worked, thank you