| | |
| | | type="textarea" |
| | | autocomplete="off" |
| | | resize="none" |
| | | :readonly="disabled" |
| | | ></el-input> |
| | | <codemirror |
| | | v-else |
| | | class="nowheel overflow-auto [&>.cm-editor]:min-h-[140px] cursor-text" |
| | | class="nowheel overflow-auto cursor-text" |
| | | v-model="editValue" |
| | | :autofocus="true" |
| | | :indent-with-tab="true" |
| | | :tab-size="2" |
| | | :extensions="editorExtensions" |
| | | :disabled="disabled" |
| | | /> |
| | | <!-- <el-tooltip effect="dark" content="全屏" placement="top"> |
| | | |
| | | </el-tooltip> --> |
| | | <YWIcon |
| | | class="absolute right-1 top-1 cursor-pointer" |
| | | class="absolute right-4 top-1 cursor-pointer" |
| | | :class="[defaultLanguage !== 'text' ? '!text-gray-300' : '!text-gray-500']" |
| | | name="pingmufangda" |
| | | @click="fullEditCodeClick" |
| | |
| | | v-model:defaultLanguage="defaultLanguage" |
| | | showCopy |
| | | :title="title" |
| | | :disabled="disabled" |
| | | /> |
| | | </Teleport> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup lang="ts" name="CodeEditor"> |
| | | import { computed, onMounted, ref, type PropType } from 'vue'; |
| | | import { computed, ref, type PropType } from 'vue'; |
| | | import { Codemirror } from 'vue-codemirror'; |
| | | import TextEditDialog from '../../dialog/TextEditDialog/index.vue'; |
| | | import type { TextType } from './types'; |
| | |
| | | type: String, |
| | | default: '', |
| | | }, |
| | | disabled: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | }); |
| | | |
| | | const { editorExtensions } = useEditorExtensions({ |