Skip to content
On this page

Transform

When To Use

Special component for code conversion (with its own layout), which can be used directly to quickly generate ui layout and simple conversion logic, suitable for most code conversion situations, such as json to yaml

Examples

  

Out-of-the-box plug-in solution, developers only need to pay attention to the conversion logic

<template>
  <div style="height: 500px">
    <h-transform  :onChange="handleChange" :onMounted="handleMounted" :save-options="{autoSave:true,key:'input1'}"/>
  </div>
</template>

<script setup lang="ts">
import { Ref } from 'vue';

const handleChange = (inputValue: Ref<string>) => {
  // do something
  return '';
};

const handleMounted = (inputValue: Ref<string>) => {
  // Mounted hook
};
</script>

API

Props

PropertyDescriptionTypedefault
leftConfigleft editor configurationConfig
rightConfigRight editor configurationConfig
canChooseFileWhether to support file selectionbooleantrue
onMountedCallback function when mountedFunction
onChangeCallback function when the input box changesFunction
onResultChangeCallback function when the result changesFunction
autoFillInputConditionClipboard automatic backfill judgment functionFunctionnull
saveOptionsAutomatically upload and initialize component data.
Note ⚠️: Multiple key values under the same tool need to be unique.
objectautoSave:false,key:""

Config

PropertyDescriptionTypedefault
placeholderPlaceholder of inputstring
langeditor programming languageCodeEditorLanguagesUnio
themeeditor themeCodeEditorThemesUnio
titleeditor titlestring
isTitleShowWhether to show the editor titleboolean

Slot

Slot NameDescriptionTypedefault
leftleft button slotButton
rightright button slotButton