I have a Submit button that once pressed run onSubmit function.
<b-form @submit.stop.prevent="handleSubmit(onSubmit)">
...
<b-button
type="submit"
>Submit</b-button>
<script lang="ts">
private async onSubmit() {
...
}
I want to add a layer before this.
If condition is met, display a modal/message. if confirm run onSubmit, else nothing.
The closest I could find what I needed was
onclick="return confirm('message')"
but I couldn’t get it to display a modal.
I am considering adding another Submit button that display the modal @click, but it’s not clean.
<b-button
v-if=conditions
@click=showmodal
>Submit</b-button>
<b-button v-else
type="submit"
>Submit</b-button>
<b-modal @ok=submit
Another problem with trying to use onclick is this error. Variable, function, etc.
ReferenceError: message is not defined
at HTMLButtonElement.onclick (edit:1:16)