提交 11f02fad authored 作者: 龙菲's avatar 龙菲

修复网格模式文件显示不正常的问题

上级 41138649
...@@ -101,32 +101,27 @@ export default { ...@@ -101,32 +101,27 @@ export default {
}, },
}, },
watch: { watch: {
// 文件平铺模式 排序-文件夹在前 fileList: {
fileList(newValue) { handler(newValue) {
console.log("fileList-newValue", newValue); this.fileListSorted = [...newValue]
this.fileListSorted = [...newValue] .sort((pre, next) => {
.sort((pre, next) => { return next.isDir - pre.isDir;
return next.isDir - pre.isDir; })
}) .map((item) => {
.map((item) => { return {
return { ...item,
...item, checked: false,
checked: false, };
}; });
}); },
deep: true,
immediate: true,
}, },
// 批量操作模式 - 监听被选中的文件 // 批量操作模式 - 监听被选中的文件
selectedFileList(newValue) { selectedFileList(newValue) {
this.$store.commit("changeSelectedFiles", newValue); this.$store.commit("changeSelectedFiles", newValue);
this.$store.commit("changeIsBatchOperation", newValue.length !== 0); this.$store.commit("changeIsBatchOperation", newValue.length !== 0);
}, },
fileListSorted: {
handler(value) {
console.log("监听fileListSorted", value);
},
deep: true,
immediate: true,
},
}, },
methods: { methods: {
/** /**
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论