debian-mirror-gitlab/app/assets/javascripts/vue_shared/components/dismissible_alert.vue

37 lines
598 B
Vue
Raw Normal View History

2020-03-13 15:44:24 +05:30
<script>
2021-09-30 23:02:18 +05:30
import { GlAlert, GlSafeHtmlDirective as SafeHtml } from '@gitlab/ui';
2020-03-13 15:44:24 +05:30
export default {
2021-09-30 23:02:18 +05:30
name: 'DismissibleAlert',
2020-03-13 15:44:24 +05:30
components: {
GlAlert,
},
2021-09-30 23:02:18 +05:30
directives: {
SafeHtml,
},
2020-03-13 15:44:24 +05:30
props: {
html: {
type: String,
required: false,
default: '',
},
},
data() {
return {
isDismissed: false,
};
},
methods: {
dismiss() {
this.isDismissed = true;
},
},
};
</script>
<template>
<gl-alert v-if="!isDismissed" v-bind="$attrs" @dismiss="dismiss" v-on="$listeners">
2021-09-30 23:02:18 +05:30
<div v-safe-html="html"></div>
2020-03-13 15:44:24 +05:30
</gl-alert>
</template>