This commit is contained in:
2023-11-30 08:05:35 +01:00
parent e0fe2482c6
commit 82c3420414
3 changed files with 37 additions and 44 deletions

View File

@@ -54,18 +54,19 @@ function readFile(file : any) {
const reader = new FileReader()
reader.onloadend = () => {
var result = reader.result!.toString();
console.log(result);
let result = reader.result!.toString();
let activeIndex = findIndexWithID(activeTabId.value);
let filePath = inputFile.value.value.split("\\");
let fileName = filePath.at(filePath.length - 1);
tabs.value.at(activeIndex)!.name = fileName;
updateData(result);
}
reader.readAsText(file.target.files[0]);
let activeIndex = findIndexWithID(activeTabId.value);
let filePath = inputFile.value.value.split("\\");
let fileName = filePath.at(filePath.length - 1);
tabs.value.at(activeIndex)!.name = fileName;
}
function changeActiveTab(id : number) {
@@ -84,9 +85,7 @@ function addTab() {
id: newTabId.value++,
name: "XML" + newTabId.value,
data: ""
})
console.log(tabs.value);
});
}
function removeTab(id : number) {
@@ -94,7 +93,7 @@ function removeTab(id : number) {
return
let indexToRemove = findIndexWithID(id);
switchToExistingTab(indexToRemove)
tabs.value.splice(indexToRemove, 1);