Added default tool
This commit is contained in:
		| @@ -1,9 +1,12 @@ | ||||
| <script setup lang="ts"> | ||||
| import { ref } from 'vue'; | ||||
| import { onMounted, ref } from 'vue'; | ||||
| import XmlTool from './components/XmlTool.vue' | ||||
|  | ||||
| const activeToolBox = ref('') | ||||
|  | ||||
| onMounted(() => { | ||||
|   activeToolBox.value = "xml"; | ||||
| }); | ||||
| </script> | ||||
|  | ||||
| <template> | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| <script setup lang="ts"> | ||||
| import { ref, watch } from 'vue'; | ||||
| import { onMounted, ref, watch } from 'vue'; | ||||
|  | ||||
| const xml = ref(''); | ||||
| const transform = ref(''); | ||||
| @@ -10,17 +10,17 @@ const activeXmlTool = ref('') | ||||
|  | ||||
| async function submit() { | ||||
|   const url = document.location.protocol + "//" + document.location.hostname + "/java/" + activeXmlTool.value; | ||||
|   var jsonData = JSON.stringify({ | ||||
|   var requestBody = JSON.stringify({ | ||||
|     "data": xml.value, | ||||
|     "process": transform.value, | ||||
|     "processor": "xalan", | ||||
|     "version": "3.0" | ||||
|   }); | ||||
|   var requestData = { | ||||
|     body: jsonData, | ||||
|  | ||||
|   var request = new Request(url, { | ||||
|     body: requestBody, | ||||
|     method: "POST" | ||||
|   }; | ||||
|   var request = new Request(url, requestData); | ||||
|   }); | ||||
|  | ||||
|  | ||||
|   var responseBody = await fetch(request).then(async response => { | ||||
| @@ -43,6 +43,10 @@ watch(activeXmlTool, (tool) => { | ||||
|    | ||||
|     transform.value = ""; | ||||
| }) | ||||
|  | ||||
| onMounted(() => { | ||||
|   activeXmlTool.value = "xpath"; | ||||
| }); | ||||
| </script> | ||||
|  | ||||
| <template> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user