flowing code , with q-btn inside a tempalte , it seems that submit function not fired?



  • flowing code , with q-btn inside a tempalte , it seems that submit function not fired?

    <q-form @submit=“sendMessage” class=“full-width”>
    <q-input v-model=“newMessage” label=“Label” counter maxlength=“12” dense>
    <template v-slot:after>
    <q-btn round dense flat icon=“send” type=“submit” />
    </template>
    </q-input>
    </q-form>



  • Works fine here.

    https://quasar.dev/vue-components/form#Example--Basic

    Maybe make a codepen of an example of your code?

    Scott



  • I once had a similar issue, which happens ONLY IF you have a q-btn with type=“submit” WITHIN a q-form. Try the following workaround:

    1. Remove the type=“submit” from the q-btn
    2. Add an @click=“someMethod()” to the q-btn to handle what needs to be done when the button is clicked

Log in to reply