@Submit not working in Vue typescript

I am trying to use form submit and its not being called. This is my code snipped. Not sure what I am doing wrong. Thanks for the help.

Using Vue: 3.4.18
Quasar: 2.16

:sent=”message.from == ‘me’ ? true : fal…


This content originally appeared on DEV Community and was authored by Victor

I am trying to use form submit and its not being called. This is my code snipped. Not sure what I am doing wrong. Thanks for the help.

Using Vue: 3.4.18
Quasar: 2.16




:sent="message.from == 'me' ? true : false" />




                    <template v-slot:after>
                        <q-btn round dense flat type="button" color="white" icon="send" />
                    </template>
                </q-input>
            </q-form>
        </q-toolbar>
    </q-footer>
</q-page>

import { ref } from 'vue';

const messages = ref([
{
text: 'Hey Jim, how are you?',
from: 'me'
},
{
text: 'Good thanks, Danny! How are you?',
from: 'them'
},
{
text: 'Pretty good!',
from: 'me'
}
]);

const newMessage = ref('');

function onSubmit() {
console.log('Sending message:', newMessage.value);
messages.value.push({
text: newMessage.value,
from: 'me'
});
newMessage.value = '';

console.log('Sending message:', newMessage.value);

newMessage.value = '';

};


This content originally appeared on DEV Community and was authored by Victor


Print Share Comment Cite Upload Translate Updates
APA

Victor | Sciencx (2025-03-23T23:26:37+00:00) @Submit not working in Vue typescript. Retrieved from https://www.scien.cx/2025/03/23/submit-not-working-in-vue-typescript/

MLA
" » @Submit not working in Vue typescript." Victor | Sciencx - Sunday March 23, 2025, https://www.scien.cx/2025/03/23/submit-not-working-in-vue-typescript/
HARVARD
Victor | Sciencx Sunday March 23, 2025 » @Submit not working in Vue typescript., viewed ,<https://www.scien.cx/2025/03/23/submit-not-working-in-vue-typescript/>
VANCOUVER
Victor | Sciencx - » @Submit not working in Vue typescript. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/03/23/submit-not-working-in-vue-typescript/
CHICAGO
" » @Submit not working in Vue typescript." Victor | Sciencx - Accessed . https://www.scien.cx/2025/03/23/submit-not-working-in-vue-typescript/
IEEE
" » @Submit not working in Vue typescript." Victor | Sciencx [Online]. Available: https://www.scien.cx/2025/03/23/submit-not-working-in-vue-typescript/. [Accessed: ]
rf:citation
» @Submit not working in Vue typescript | Victor | Sciencx | https://www.scien.cx/2025/03/23/submit-not-working-in-vue-typescript/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.