Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ pnpm sb
pnpm dev
```

Для локального запуска Storybook необходимо выполнить команду
```
pnpm sb
```


## Инструкции

### Получение кода на свой компьютер
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
"build-storybook": "storybook build"
},
"dependencies": {
"@tailwindcss/vite": "^4.1.16",
"pinia": "^3.0.1",
"query-string": "^9.1.1",
"storybook": "^9.1.13",
"tailwindcss": "^4.1.16",
"vue": "^3.5.13",
"vue-router": "^4.5.0"
},
Expand Down Expand Up @@ -53,6 +55,7 @@
"knip": "^5.45.0",
"openapi-typescript": "^7.6.1",
"playwright": "^1.56.1",
"postcss-html": "^1.8.0",
"postcss-preset-env": "^10.1.5",
"prettier": "^3.5.2",
"sass": "^1.93.2",
Expand Down
601 changes: 465 additions & 136 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/components/button/VuButton.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const meta = {
component: VuButton,
tags: ['autodocs'],
args: {
text: 'Привет',
onClick: fn(),
},
} satisfies Meta<typeof VuButton>;
Expand Down
8 changes: 8 additions & 0 deletions src/components/button/VuButton.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
<script setup lang="ts">
// Определяем пропсы компонента
interface Props {
text?: string;
}

// Объявляем пропсы
defineProps<Props>();

defineEmits<{
click: [];
}>();
Expand Down
33 changes: 33 additions & 0 deletions src/components/checkBox/VuCheckbox.stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { Meta, StoryObj } from '@storybook/vue3-vite';
import VuCheckbox from './VuCheckbox.vue';

const meta = {
title: 'checkBox/VuCheckbox',
Comment thread
BatuevIO marked this conversation as resolved.
component: VuCheckbox,
} satisfies Meta<typeof VuCheckbox>;

export default meta;

type Story = StoryObj<typeof meta>;

export const Default: Story = {
args: {
disabled: false,
modelValue: false,
label: "Оценок нет"
},
};
export const Active: Story = {
args: {
disabled: false,
modelValue: true,
label: "Оценок нет"
},
};
export const Disabled: Story = {
args: {
disabled: true,
modelValue: true,
label: "Оценок нет"
},
};
25 changes: 25 additions & 0 deletions src/components/checkBox/VuCheckbox.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<script setup lang="ts">
import { computed } from 'vue';

interface Props {
disabled: boolean;
modelValue: boolean;
label: string;
}
const props = defineProps<Props>();
const emit = defineEmits(['update:modelValue'])

const value = computed({
get: () => props.modelValue,
set: (value) => emit('update:modelValue', value)
})
</script>

<template>
<v-checkbox

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В целом все ок, но у тебя получился очень большой вертикальный паддинг. Это регулируется с помощью density="compact, почитать можно тут.

density="compact"
:label="label"
v-model="value"
:disabled="disabled">
</v-checkbox>
</template>
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import { createApp } from 'vue';
import App from '@/App.vue';
import { pinia } from '@/pinia';
import { vuetify } from './vuetify';

import '../style.css'
createApp(App).use(pinia).use(vuetify).mount('#app');
1 change: 1 addition & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "tailwindcss";
Comment thread
BatuevIO marked this conversation as resolved.
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default defineConfig({
transformAssetUrls,
},
}),
tailwindcss(),
vuetify({
autoImport: true,
styles: {
Expand Down