Правка фронта
This commit is contained in:
@@ -67,11 +67,28 @@ const props = defineProps({
|
||||
|
||||
const emit = defineEmits(['close', 'update:show'])
|
||||
|
||||
const STORAGE_KEY = 'taskboard_panel_width'
|
||||
|
||||
const panelRef = ref(null)
|
||||
const panelWidth = ref(props.width)
|
||||
const panelWidth = ref(getSavedWidth())
|
||||
const isResizing = ref(false)
|
||||
const overlayMouseDownTarget = ref(false)
|
||||
|
||||
// Получить сохранённую ширину из localStorage
|
||||
function getSavedWidth() {
|
||||
const saved = localStorage.getItem(STORAGE_KEY)
|
||||
if (saved) {
|
||||
const width = parseInt(saved, 10)
|
||||
if (!isNaN(width)) return width
|
||||
}
|
||||
return props.width
|
||||
}
|
||||
|
||||
// Сохранить ширину в localStorage
|
||||
function saveWidth(width) {
|
||||
localStorage.setItem(STORAGE_KEY, String(width))
|
||||
}
|
||||
|
||||
// Resize логика
|
||||
const startResize = (e) => {
|
||||
if (!props.resizable) return
|
||||
@@ -89,6 +106,9 @@ const onResize = (e) => {
|
||||
}
|
||||
|
||||
const stopResize = () => {
|
||||
// Сохраняем ширину в localStorage
|
||||
saveWidth(panelWidth.value)
|
||||
|
||||
setTimeout(() => {
|
||||
isResizing.value = false
|
||||
}, 100)
|
||||
@@ -122,10 +142,10 @@ const refreshIcons = () => {
|
||||
}
|
||||
}
|
||||
|
||||
// Сброс ширины при открытии
|
||||
// Восстановление ширины при открытии (из localStorage или дефолтная)
|
||||
watch(() => props.show, (newVal) => {
|
||||
if (newVal) {
|
||||
panelWidth.value = props.width
|
||||
panelWidth.value = getSavedWidth()
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user