//字符串拼接,第一次写的
CmdClick(): void {
// 向上返回一级
let that = this;
this.FilePath = this.FilePath.substring(0, this.FilePath.lastIndexOf("/"));
this.FilePath = this.FilePath.substring(0, this.FilePath.lastIndexOf("/"));
this.FilePath = this.FilePath + "/";
this.GetFileDirectory();
}
DirClick(dirName: string): void {
//进入文件夹目录
let that = this;
this.FilePath = this.FilePath + "/" +dirName;
this.GetFileDirectory();
}
//正则表达式
CmdClick(): void {
// 向上返回一级
this.FilePath = this.FilePath.replace(/^(.*)[\\*|\/*]$/g, "$1");
let indexPos = this.FilePath.lastIndexOf("/");
indexPos = indexPos > this.FilePath.lastIndexOf('\\') ? indexPos : this.FilePath.lastIndexOf('\\');
this.FilePath = this.FilePath.slice(0, indexPos);
this.GetFileDirectory();
}
DirClick(dirName: string): void {
//进入文件夹目录
this.FilePath = this.FilePath.replace(/^(.*)[\\*|\/*]$/g, "$1");
this.FilePath = this.FilePath + "/" + dirName;
this.GetFileDirectory();
}