Files
vue-pult/docs/migration/header/SHIFT_BUTTON.md
2025-10-01 11:54:13 +03:00

33 lines
1.5 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Документация по переносу кнопки "Смена" в хедере
## Общая структура в React
- **Расположение**: В AppHeader.tsx, правая часть flex, первая кнопка.
- **Тип**: Button элемент с @click={onOpenShift}, title="Открыть смену".
- **Зависимости**: Tailwind CSS, lucide-react (Calendar icon).
- **JSX**: <button class="bg-blue-600 hover:bg-blue-700 text-white px-3 py-1.5 rounded text-sm transition-colors" title="Открыть смену">
<Calendar class="w-4 h-4" />
Смена
</button>.
## Элементы
- Иконка: Calendar (w-4 h-4, белая).
- Текст: "Смена" (text-sm).
- Title: "Открыть смену" (tooltip).
- Handler: onOpenShift — вызывает модал ShiftModal.
## Стили (Tailwind примеры)
- Основной: bg-blue-600 text-white px-3 py-1.5 rounded text-sm transition-colors.
- Hover: hover:bg-blue-700.
- Responsive: text-xs на mobile, min-height 44px touch.
## Взаимодействие
- Клик: Вызывает props.onOpenShift, открывает ShiftModal для управления сменой.
- В Dashboard: <AppHeader onOpenShift={handleOpenShift} />.
## Vue маппинг
- <template>: <button @click="onOpenShift" class="bg-blue-600 hover:bg-blue-700 ..." title="Открыть смену">
<Calendar class="w-4 h-4" />
Смена
</button>.
- defineProps: { onOpenShift: Function }.
- Импорт: import { Calendar } from 'lucide-vue-next'.