Skip to content

Commit

Permalink
feat: 侧栏宽度调整, 适配多级目录
Browse files Browse the repository at this point in the history
  • Loading branch information
IITII committed Feb 23, 2024
1 parent 5d4bb19 commit 75846b2
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/waterfall/PicDrawer.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div>
<q-drawer v-model="leftDrawerSync" content-class="bg-grey-1" elevated show-if-above>
<q-drawer v-model="leftDrawerSync" content-class="bg-grey-1" elevated show-if-above :width="drawer_width">
<div class="q-pa-md q-gutter-sm">
<div style="text-align: center">
<q-badge :color="badge.color" :text-color="badge.text_color">
Expand Down Expand Up @@ -82,6 +82,7 @@ export default {
currentNodeKey: state => state[self.storeName].node_key,
node_dir: state => state[self.storeName].node_dir,
drawer_open: state => state[self.storeName].drawer_open,
drawer_width: state => state[self.storeName].drawer_width,
}),
leftDrawerSync: {
get: function () {
Expand Down
4 changes: 4 additions & 0 deletions src/store/modules/image/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,8 @@ export const node_dir = ({commit}, payload) => {
persistent.imageSet('node_dir', payload)
commit('node_dir', payload)
}
export const drawer_width = ({commit}, payload) => {
persistent.imageSet('drawer_width', payload)
commit('drawer_width', payload)
}

1 change: 1 addition & 0 deletions src/store/modules/image/getters.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ export const title_max_length = state => state.title_max_length
export const viewer_play_interval = state => state.viewer_play_interval
export const auto_next = state => state.auto_next
export const node_dir = state => state.node_dir
export const drawer_width = state => state.drawer_width
1 change: 1 addition & 0 deletions src/store/modules/image/mutations.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ export const title_max_length = (state, payload) => state.title_max_length = pay
export const viewer_play_interval = (state, payload) => state.viewer_play_interval = payload
export const auto_next = (state, payload) => state.auto_next = payload
export const node_dir = (state, payload) => state.node_dir = payload
export const drawer_width = (state, payload) => state.drawer_width = payload
2 changes: 2 additions & 0 deletions src/store/modules/image/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ const state = {
// The amount of time to delay between automatically cycling an image when playing.
viewer_play_interval: persistent.imageGet('viewer_play_interval') || 2000,
auto_next: persistent.imageGet('auto_next') !== 'false',
// 默认最长标题长度
drawer_width: parseInt(persistent.imageGet('drawer_width')) || 300,
}

export default function () {
Expand Down
4 changes: 4 additions & 0 deletions src/store/modules/video/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,8 @@ export const node_dir = ({commit}, payload) => {
persistent.videoSet('node_dir', payload)
commit('node_dir', payload)
}
export const drawer_width = ({commit}, payload) => {
persistent.videoSet('drawer_width', payload)
commit('drawer_width', payload)
}

1 change: 1 addition & 0 deletions src/store/modules/video/getters.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ export const waterfall_stride = state => state.waterfall_stride
export const title_max_length = state => state.title_max_length
export const auto_next = state => state.auto_next
export const node_dir = state => state.node_dir
export const drawer_width = state => state.drawer_width
1 change: 1 addition & 0 deletions src/store/modules/video/mutations.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ export const waterfall_stride = (state, payload) => state.waterfall_stride = pay
export const title_max_length = (state, payload) => state.title_max_length = payload
export const auto_next = (state, payload) => state.auto_next = payload
export const node_dir = (state, payload) => state.node_dir = payload
export const drawer_width = (state, payload) => state.drawer_width = payload
2 changes: 2 additions & 0 deletions src/store/modules/video/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ const state = {
// 默认最长标题长度
title_max_length: parseInt(persistent.videoGet('title_max_length')) || 120,
auto_next: persistent.videoGet('auto_next') === 'true',
// 默认最长标题长度
drawer_width: parseInt(persistent.imageGet('drawer_width')) || 300,
}

export default function () {
Expand Down

0 comments on commit 75846b2

Please sign in to comment.