<template>
  <w-dialog ref="dialogRef" :title="$t('re.dictionary.sampleJson.dialog.title')" width="600px" :can-maximize="false">
    <div class="pt-2">
      <w-code-mirror v-model="sourceCodeRef" lang="json" :rows="15" :toolbar="false"></w-code-mirror>
    </div>
  </w-dialog>
</template>
<script setup lang="ts">
import { ref } from 'vue';

const dialogRef = ref();
const sourceCodeRef = ref();

const open = (sourceCode: string) => {
  sourceCodeRef.value = sourceCode;
  dialogRef.value.show();
};

const close = () => {
  dialogRef.value.hide();
};

defineExpose({
  open,
  close,
});
</script>
