<template>
  <w-dialog ref="dialogRef" :title="$t('re.dictionary.sampleJson.dialog.title')" width="600px" :can-maximize="false">
    <w-code-mirror v-model="sourceCodeRef" lang="json" :rows="15"></w-code-mirror>
  </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>
