Removed old tab component
This commit is contained in:
		@@ -1,52 +0,0 @@
 | 
			
		||||
<script setup lang="ts">
 | 
			
		||||
import XmlInputFieldComponent from './XmlInputFieldComponent.vue';
 | 
			
		||||
import TabComponent from './TabComponent.vue';
 | 
			
		||||
import { ref } from 'vue'
 | 
			
		||||
 | 
			
		||||
const data = ref(new Array<string>)
 | 
			
		||||
 | 
			
		||||
const activeTabId = ref(0);
 | 
			
		||||
 | 
			
		||||
const nextTabId = ref(2);
 | 
			
		||||
 | 
			
		||||
const tabs = ref(new Array<string>);
 | 
			
		||||
tabs.value.push("XML1");
 | 
			
		||||
data.value.push("dupa")
 | 
			
		||||
 | 
			
		||||
function changeActiveTab(newActiveTabId : number) {
 | 
			
		||||
    activeTabId.value = newActiveTabId;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function removeTab(tabId : number) {
 | 
			
		||||
    if (tabs.value.length <= 1)
 | 
			
		||||
        return
 | 
			
		||||
 | 
			
		||||
    tabs.value.splice(tabId, 1);
 | 
			
		||||
    data.value.splice(tabId, 1);
 | 
			
		||||
    if (tabId == activeTabId.value)
 | 
			
		||||
        activeTabId.value = 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function addTab() {
 | 
			
		||||
    tabs.value.push("XML" + (nextTabId.value++));
 | 
			
		||||
    data.value.push("")
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<template>
 | 
			
		||||
    <div class="flex flex-col justify-stretch items-stretch rounded-2xl mr-2">
 | 
			
		||||
        <div class="flex flex-row justify-between ml-4">
 | 
			
		||||
            <div class="flex flex-row h-1/12 grow-0 gap-2">
 | 
			
		||||
                <!-- <TabComponent v-for="item in tabs" :id="tabs.indexOf(item)" @activate="changeActiveTab" @remove="removeTab" :active-tab-id="activeTabId">{{ item }}</TabComponent> -->
 | 
			
		||||
            </div>
 | 
			
		||||
            <div>
 | 
			
		||||
                <button @click="addTab" class="tool-button">New</button>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
        
 | 
			
		||||
        <div class="flex-1 h-11/12 dark:bg-gray-700 p-2 rounded-xl border border-slate-400 overflow-auto">
 | 
			
		||||
            <XmlInputFieldComponent class="h-full" stylized-name="XML" :data="data[activeTabId]"></XmlInputFieldComponent>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
</template>
 | 
			
		||||
		Reference in New Issue
	
	Block a user