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
|
<script>
import { GlButtonGroup, GlButton } from '@gitlab/ui';
// TODO: We're planning to move this component to GitLab UI
// https://gitlab.com/gitlab-org/gitlab-ui/-/issues/1787
export default {
components: {
GlButtonGroup,
GlButton,
},
props: {
options: {
type: Array,
required: true,
},
value: {
type: [String, Number, Boolean],
required: true,
},
},
};
</script>
<template>
<gl-button-group>
<gl-button
v-for="opt in options"
:key="opt.value"
:disabled="!!opt.disabled"
:selected="value === opt.value"
@click="$emit('input', opt.value)"
>
<slot name="button-content" v-bind="opt">{{ opt.text }}</slot>
</gl-button>
</gl-button-group>
</template>
|