mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-04 23:18:44 +08:00
fix
This commit is contained in:
@@ -108,8 +108,9 @@ async function deleteItem(item: FileItem) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 切换路径
|
// 切换路径
|
||||||
function changePath(path: string) {
|
function changePath(_path: string) {
|
||||||
console.log('List changePath', path)
|
path.value = _path
|
||||||
|
console.log('List changePath', path.value)
|
||||||
emit('pathchanged', path)
|
emit('pathchanged', path)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,8 +51,9 @@ function changeStorage(code: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 路径变化
|
// 路径变化
|
||||||
function changePath(path: string) {
|
function changePath(_path: string) {
|
||||||
console.log('Toolbar changePath', path)
|
path.value = _path
|
||||||
|
console.log('Toolbar changePath', path.value)
|
||||||
emit('pathchanged', path)
|
emit('pathchanged', path)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ const props = defineProps({
|
|||||||
// 对外事件
|
// 对外事件
|
||||||
const emit = defineEmits(['pathchanged', 'loading', 'refreshed'])
|
const emit = defineEmits(['pathchanged', 'loading', 'refreshed'])
|
||||||
|
|
||||||
|
// 当前路径
|
||||||
|
const path = ref(props.path)
|
||||||
|
|
||||||
// 变量
|
// 变量
|
||||||
const open = ref<string[]>([])
|
const open = ref<string[]>([])
|
||||||
// 活跃的文件夹
|
// 活跃的文件夹
|
||||||
@@ -99,17 +102,19 @@ watch(() => props.storage, () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// 监听路径变化
|
// 监听路径变化
|
||||||
watch(() => props.path, () => {
|
watch(
|
||||||
if (props.path) {
|
path,
|
||||||
active.value = [props.path]
|
() => {
|
||||||
if (!open.value.includes(props.path))
|
if (props.path) {
|
||||||
open.value.push(props.path)
|
active.value = [props.path]
|
||||||
}
|
if (!open.value.includes(props.path))
|
||||||
})
|
open.value.push(props.path)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
// 监听 refreshPending
|
// 监听 refreshPending
|
||||||
watch(
|
watch(
|
||||||
() => refreshPending.value,
|
refreshPending,
|
||||||
async () => {
|
async () => {
|
||||||
if (refreshPending.value && props.path) {
|
if (refreshPending.value && props.path) {
|
||||||
const item = findItem(props.path)
|
const item = findItem(props.path)
|
||||||
|
|||||||
Reference in New Issue
Block a user