(value: string)
| 82 | } |
| 83 | |
| 84 | private submit(value: string) { |
| 85 | const fileName = value.trim(); |
| 86 | if (fileName) { |
| 87 | let fullPath = ""; |
| 88 | // 如果用户输入了包含斜杠的路径,则忽略默认位置,直接使用用户输入的路径 |
| 89 | if (fileName.includes("/")) { |
| 90 | fullPath = normalizePath(fileName); |
| 91 | } else { |
| 92 | // 否则使用选中的位置 + 文件名 |
| 93 | fullPath = normalizePath(this.currentPath + "/" + fileName); |
| 94 | } |
| 95 | this.result = fullPath; |
| 96 | this.close(); |
| 97 | } else { |
| 98 | new Notice("Please enter a file name"); |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | onClose() { |
| 103 | super.onClose(); |