Added clear button for formatter
This commit is contained in:
@@ -40,5 +40,5 @@ function setDefault() {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<button class="tool-button" @click="setDefault()">Insert default {{ prettyName }}</button>
|
<button class="tool-button" @click="setDefault()">Default {{ prettyName }}</button>
|
||||||
</template>
|
</template>
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
<script setup lang="ts">
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div class="flex h-full"></div>
|
|
||||||
|
|
||||||
<textarea name="data" id="data" class="text-field"></textarea>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style scoped></style>
|
|
||||||
@@ -14,6 +14,10 @@ function format(formattedXml: any) {
|
|||||||
xml.value = formattedXml.result;
|
xml.value = formattedXml.result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function clear() {
|
||||||
|
xml.value = '';
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -22,6 +26,7 @@ function format(formattedXml: any) {
|
|||||||
<span class="dark:text-slate-100">XML Formatter</span>
|
<span class="dark:text-slate-100">XML Formatter</span>
|
||||||
<div class="space-x-2">
|
<div class="space-x-2">
|
||||||
<InsertTemplateComponent pretty-name="XML" @update:defaultData="(data: string) => setTextFieldValue(data)"></InsertTemplateComponent>
|
<InsertTemplateComponent pretty-name="XML" @update:defaultData="(data: string) => setTextFieldValue(data)"></InsertTemplateComponent>
|
||||||
|
<button class="tool-button" @click="clear()">Clear</button>
|
||||||
<XMLButtonFormatterComponent :xml="xml" @update:result="(data: any) => format(data)"></XMLButtonFormatterComponent>
|
<XMLButtonFormatterComponent :xml="xml" @update:result="(data: any) => format(data)"></XMLButtonFormatterComponent>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user