feat: Creates add button component for label (#2223)
This commit is contained in:
parent
6245a10a70
commit
5c80d0ac42
2 changed files with 44 additions and 0 deletions
|
@ -0,0 +1,19 @@
|
|||
import { action } from '@storybook/addon-actions';
|
||||
import AddLabel from './AddLabel';
|
||||
|
||||
export default {
|
||||
title: 'Components/Label/Add Button',
|
||||
component: AddLabel,
|
||||
argTypes: {},
|
||||
};
|
||||
|
||||
const Template = (args, { argTypes }) => ({
|
||||
props: Object.keys(argTypes),
|
||||
components: { AddLabel },
|
||||
template: '<add-label v-bind="$props" @add="onClick"></add-label>',
|
||||
});
|
||||
|
||||
export const AddButton = Template.bind({});
|
||||
AddButton.args = {
|
||||
onClick: action('opened'),
|
||||
};
|
25
app/javascript/shared/components/ui/dropdown/AddLabel.vue
Normal file
25
app/javascript/shared/components/ui/dropdown/AddLabel.vue
Normal file
|
@ -0,0 +1,25 @@
|
|||
<template>
|
||||
<div>
|
||||
<woot-button
|
||||
variant="hollow"
|
||||
size="tiny"
|
||||
icon="ion-plus-round"
|
||||
color-scheme="secondary"
|
||||
@click="toggleLabels"
|
||||
>
|
||||
{{ $t('CONTACT_PANEL.LABELS.MODAL.ADD_BUTTON') }}
|
||||
</woot-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
methods: {
|
||||
toggleLabels() {
|
||||
this.$emit('add');
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
Loading…
Reference in a new issue