traxxx/assets/components/alerts/remove.vue

42 lines
635 B
Vue
Raw Normal View History

2021-03-20 22:03:13 +00:00
<template>
<Dialog
2021-04-04 22:48:03 +00:00
title="Remove alert"
2021-03-20 22:03:13 +00:00
@close="$emit('close', false)"
>
2021-04-04 22:48:03 +00:00
<form
class="dialog-body"
@submit.prevent="removeAlert"
>
Are you sure you want to remove alert?
2021-03-20 22:03:13 +00:00
<div class="dialog-actions right">
<button
type="submit"
class="button button-primary"
>Remove</button>
</div>
</form>
</Dialog>
</template>
<script>
2021-04-04 22:48:03 +00:00
async function removeAlert() {
await this.$store.dispatch('removeAlert', this.alert.id);
2021-03-20 22:03:13 +00:00
this.$emit('close', true);
}
export default {
props: {
2021-04-04 22:48:03 +00:00
alert: {
2021-03-20 22:03:13 +00:00
type: Object,
default: null,
},
},
emits: ['close'],
methods: {
2021-04-04 22:48:03 +00:00
removeAlert,
2021-03-20 22:03:13 +00:00
},
};
</script>