mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2024-11-01 06:02:38 +08:00
优化编辑器
This commit is contained in:
parent
d2a55fe8f4
commit
83859b685a
@ -232,7 +232,9 @@ export async function createMenu({ router, columns, prefix, api, filePath }: any
|
||||
upsert.items.push(format(item));
|
||||
}
|
||||
|
||||
if (!["cl-codemirror", "cl-editor-quill"].includes(column.component?.name)) {
|
||||
if (
|
||||
!["cl-codemirror", "cl-editor-quill", "cl-editor-wang"].includes(column.component?.name)
|
||||
) {
|
||||
table.columns.push(format(column));
|
||||
}
|
||||
});
|
||||
|
@ -177,11 +177,8 @@ export default [
|
||||
},
|
||||
{
|
||||
test: ["rich", "text", "html", "content", "introduce", "description", "desc"],
|
||||
table: {
|
||||
name: "cl-editor-quill"
|
||||
},
|
||||
form: {
|
||||
name: "cl-editor-quill",
|
||||
name: "cl-editor-wang",
|
||||
props: {
|
||||
height: 400
|
||||
}
|
||||
@ -189,9 +186,6 @@ export default [
|
||||
},
|
||||
{
|
||||
test: ["code", "codes"],
|
||||
table: {
|
||||
name: "cl-codemirror"
|
||||
},
|
||||
form: {
|
||||
name: "cl-codemirror",
|
||||
props: {
|
||||
|
@ -37,9 +37,10 @@
|
||||
|
||||
<script lang="ts" name="cl-editor-wang" setup>
|
||||
import "@wangeditor/editor/dist/css/style.css";
|
||||
import { onBeforeUnmount, ref, shallowRef, watch, PropType, reactive } from "vue";
|
||||
import { onBeforeUnmount, ref, shallowRef, watch, PropType, reactive, computed } from "vue";
|
||||
import { Editor, Toolbar } from "@wangeditor/editor-for-vue";
|
||||
import { IEditorConfig } from "@wangeditor/editor";
|
||||
import { isNumber } from "lodash-es";
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: String,
|
||||
@ -48,8 +49,8 @@ const props = defineProps({
|
||||
default: "default"
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: "400px"
|
||||
type: [String, Number],
|
||||
default: 400
|
||||
}
|
||||
});
|
||||
|
||||
@ -59,8 +60,12 @@ const ImageSpace = ref();
|
||||
const VideoSpace = ref();
|
||||
const editorRef = shallowRef();
|
||||
|
||||
// 内容
|
||||
const value = ref();
|
||||
|
||||
// 编辑器高度
|
||||
const height = computed(() => (isNumber(props.height) ? `${props.height}px` : props.height));
|
||||
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(val) => {
|
||||
|
@ -2,12 +2,12 @@
|
||||
<div class="editor scroller1">
|
||||
<div class="item">
|
||||
<p class="title">Wang</p>
|
||||
<cl-editor-wang v-model="w" height="400px" />
|
||||
<cl-editor-wang v-model="w" :height="300" />
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<p class="title">Quill</p>
|
||||
<cl-editor-quill v-model="q" height="400px" />
|
||||
<cl-editor-quill v-model="q" :height="300" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
Loading…
Reference in New Issue
Block a user