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