添加miaoContextMenu用于自定义右键菜单
This commit is contained in:
1 parent
ed364f6343
commit
60477a9112
8 files changed
+281
-155
No files matched your search
@@ -80,11 +80,11 @@ class VirtualDirectory {
|
||||
* @param {number} layer 需要跳转的层数
|
||||
* @returns {VirtualDirectory}
|
||||
*/
|
||||
getParent(layer: number): VirtualDirectory {
|
||||
getParents(layer: number): VirtualDirectory {
|
||||
if (layer <= 0 || !this.parent) {
|
||||
return this;
|
||||
}
|
||||
return this.parent.getParent(layer - 1);
|
||||
return this.parent.getParents(layer - 1);
|
||||
}
|
||||
|
||||
updateContent(content: (file | directory)[]) {
|
||||
|
||||
@@ -13,20 +13,23 @@ const getRandomWebSafeColor = (() => {
|
||||
})();
|
||||
|
||||
export default class VirtualPage {
|
||||
constructor(component: any, initObjects: (VirtualDirectory | VirtualFile)[]) {
|
||||
constructor(component: any, initObjects?:{ directorys?: VirtualDirectory[], files?: VirtualFile[]}) {
|
||||
this.component = shallowRef(component);
|
||||
this.currentObjects = initObjects;
|
||||
|
||||
this.currentDirectorys = initObjects?.directorys ?? [];
|
||||
this.currentFiles = initObjects?.files ?? [];
|
||||
this.visible = true;
|
||||
this.uid = generateId();
|
||||
this.refreshKey = Math.random();
|
||||
this.color = getRandomWebSafeColor();
|
||||
}
|
||||
// 页面使用的组件
|
||||
component: any;
|
||||
// 是否可见
|
||||
visible: boolean;
|
||||
// 当前正在使用的文件或是文件夹
|
||||
currentObjects: (VirtualDirectory | VirtualFile)[];
|
||||
// 当前正在使用的文件夹
|
||||
currentDirectorys: VirtualDirectory[];
|
||||
// 当前正在使用的文件
|
||||
currentFiles: VirtualFile[];
|
||||
// 区分每一个页面的唯一id
|
||||
uid: number;
|
||||
// 当refreshKey改变时需要刷新页面,目前还没接入刷新
|
||||
@@ -40,7 +43,7 @@ export default class VirtualPage {
|
||||
if (this._title) {
|
||||
return this._title;
|
||||
}
|
||||
return this.currentObjects[0].name;
|
||||
return this.currentDirectorys[0].name;
|
||||
}
|
||||
|
||||
setTitle(title: string) {
|
||||
|
||||
Reference in new issue
Block a user