Ben Lin
2024-06-19 f96d4ed77603ca1f908dcdc4a51bd2ce2178d10c
src/components/CodeEditor/src/CodeEditor.vue
@@ -5,14 +5,17 @@
      @change="handleValueChange"
      :mode="mode"
      :readonly="readonly"
      :bordered="bordered"
      :config="config"
    />
  </div>
</template>
<script lang="ts" setup>
  import { computed } from 'vue';
  import CodeMirrorEditor from './codemirror/CodeMirror.vue';
  import { isString } from '/@/utils/is';
  import { isString } from '@/utils/is';
  import { MODE } from './typing';
  import type { EditorConfiguration } from 'codemirror';
  const props = defineProps({
    value: { type: [Object, String] as PropType<Record<string, any> | string> },
@@ -26,6 +29,8 @@
    },
    readonly: { type: Boolean },
    autoFormat: { type: Boolean, default: true },
    bordered: { type: Boolean, default: false },
    config: { type: Object as PropType<EditorConfiguration>, default: () => {} },
  });
  const emit = defineEmits(['change', 'update:value', 'format-error']);