1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
<script>
import { GlLink, GlAlert } from '@gitlab/ui';
export default {
name: 'MRWidgetAlertMessage',
components: {
GlAlert,
GlLink,
},
props: {
type: {
type: String,
required: true,
},
helpPath: {
type: String,
required: false,
default: undefined,
},
dismissible: {
type: Boolean,
required: false,
default: false,
},
},
data() {
return {
isDismissed: false,
};
},
methods: {
onDismiss() {
this.isDismissed = true;
},
},
};
</script>
<template>
<gl-alert v-if="!isDismissed" :variant="type" :dismissible="dismissible" @dismiss="onDismiss">
<slot></slot>
<gl-link v-if="helpPath" :href="helpPath" target="_blank" class="gl-label-link">
<slot name="link-content"></slot>
</gl-link>
</gl-alert>
</template>
|