I am currently implementing the Buefy UI Components and I need to pass the $(value)
value outside of the function so that I can use it in an alert(thevalue)
or something similar. I have scoured the internet for a solution but haven't been able to find one that works. Any help you can provide on this would be greatly appreciated!
<template>
<section>
<div class="buttons">
<button
class="button is-medium is-dark"
@click="prompt">
Launch prompt (default)
</button>
</div>
</section>
</template>
<script>
export default {
methods: {
prompt() {
this.$buefy.dialog.prompt({
message: `What's your name?`,
inputAttrs: {
placeholder: 'e.g. Walter',
maxlength: 10
},
trapFocus: true,
onConfirm: (value) => this.$buefy.toast.open(`Your name is: ${value}`)
})
}
}
}
</script>