Extracted condition to function
This commit is contained in:
		| @@ -26,6 +26,10 @@ function clear() { | ||||
|     updateData(''); | ||||
| } | ||||
|  | ||||
| function isXMLField() { | ||||
|     return props.prettyName.toLowerCase() == 'xml'; | ||||
| } | ||||
|  | ||||
| </script> | ||||
|  | ||||
| <template> | ||||
| @@ -34,7 +38,7 @@ function clear() { | ||||
|             <span class="dark:text-white">{{ prettyName }}</span> | ||||
|             <div class="flex space-x-2"> | ||||
|                 <InsertTemplateComponent :pretty-name="props.prettyName" @update:default-data="(data: string) => updateData(data)"></InsertTemplateComponent> | ||||
|                 <XMLButtonFormatterComponent v-if="props.prettyName == 'XML'" :xml="data" @update:result="(data:any) => updateData(data.result)"></XMLButtonFormatterComponent> | ||||
|                 <XMLButtonFormatterComponent v-if="isXMLField()" :xml="data" @update:result="(data:any) => updateData(data.result)"></XMLButtonFormatterComponent> | ||||
|                 <button class="tool-button" @click="clear">Clear</button> | ||||
|             </div> | ||||
|         </div> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user