神仙都没用 1 سال پیش
والد
کامیت
9b8769d0b2
2فایلهای تغییر یافته به همراه11 افزوده شده و 2 حذف شده
  1. 11 1
      src/modules/extend/editor/preview.vue
  2. 0 1
      src/modules/magic/hooks/menu.ts

+ 11 - 1
src/modules/extend/editor/preview.vue

@@ -1,10 +1,15 @@
 <template>
 <template>
 	<div>
 	<div>
+		<slot>
+			<el-button @click="open()">点击查看</el-button>
+		</slot>
+
 		<cl-dialog width="1000px" :title="title" append-to-body v-model="visible">
 		<cl-dialog width="1000px" :title="title" append-to-body v-model="visible">
 			<cl-editor
 			<cl-editor
 				:name="`cl-editor-${name}`"
 				:name="`cl-editor-${name}`"
 				:ref="setRefs('editor')"
 				:ref="setRefs('editor')"
 				:height="600"
 				:height="600"
+				preview
 				v-bind="props.props"
 				v-bind="props.props"
 				v-model="text"
 				v-model="text"
 			/>
 			/>
@@ -25,6 +30,7 @@ import { nextTick, PropType, ref } from "vue";
 import { useCool } from "/@/cool";
 import { useCool } from "/@/cool";
 
 
 const props = defineProps({
 const props = defineProps({
+	modelValue: String,
 	title: {
 	title: {
 		type: String,
 		type: String,
 		default: "文本预览"
 		default: "文本预览"
@@ -45,7 +51,11 @@ const visible = ref(false);
 // 文本
 // 文本
 const text = ref("");
 const text = ref("");
 
 
-async function open(data: string) {
+async function open(data?: string) {
+	if (!data) {
+		data = props.modelValue;
+	}
+
 	if (isString(data)) {
 	if (isString(data)) {
 		text.value = data;
 		text.value = data;
 	}
 	}

+ 0 - 1
src/modules/magic/hooks/menu.ts

@@ -71,7 +71,6 @@ export function useCode() {
 
 
 			// 编辑器处理
 			// 编辑器处理
 			if (item.component?.name?.includes("cl-editor-")) {
 			if (item.component?.name?.includes("cl-editor-")) {
-				table.columns.push(column);
 				column.component = {
 				column.component = {
 					name: "cl-editor-preview",
 					name: "cl-editor-preview",
 					props: {
 					props: {