|
|
@@ -3477,13 +3477,9 @@ import { EVEN_VAR } from "./EventBus.js";
|
|
|
type: String,
|
|
|
default: "请输入内容",
|
|
|
},
|
|
|
- readonly: {
|
|
|
- type: Boolean,
|
|
|
- default: false,
|
|
|
- },
|
|
|
mode: {
|
|
|
type: String,
|
|
|
- default: "edit", // 'edit' | 'view'
|
|
|
+ default: "edit", // 'edit' | 'play'
|
|
|
},
|
|
|
uploadUrl: {
|
|
|
type: String,
|
|
|
@@ -3508,9 +3504,6 @@ import { EVEN_VAR } from "./EventBus.js";
|
|
|
const uniqueId = "editor-" + Date.now();
|
|
|
const errMsg = Vue.ref("");
|
|
|
|
|
|
- // 计算是否只读:mode='play' 表示只读 by xu 20250402
|
|
|
- const isReadonly = computed(() => props.mode === "play");
|
|
|
-
|
|
|
// button 支持对象(旧格式,单个附件按钮)或数组(新格式,多个按钮)by xu 20250331
|
|
|
const buttonConfigRaw = props.param && props.param.button ? props.param.button : null;
|
|
|
const buttonArray = Array.isArray(buttonConfigRaw)
|
|
|
@@ -3695,7 +3688,7 @@ import { EVEN_VAR } from "./EventBus.js";
|
|
|
validate();
|
|
|
|
|
|
// 只读模式下不初始化 Jodit,直接设置内容 by xu 20250402
|
|
|
- if (isReadonly) {
|
|
|
+ if (props.mode === "play") {
|
|
|
if (props.html) {
|
|
|
setEditorHtml(props.html);
|
|
|
} else if (props.url) {
|
|
|
@@ -3794,7 +3787,7 @@ import { EVEN_VAR } from "./EventBus.js";
|
|
|
const editor = Jodit.make(`#${uniqueId}`, {
|
|
|
height: props.height,
|
|
|
placeholder: props.placeholder,
|
|
|
- readonly: isReadonly,
|
|
|
+ readonly: props.mode === "play",
|
|
|
language: "zh_cn",
|
|
|
i18n: {
|
|
|
zh_cn: {
|
|
|
@@ -4205,7 +4198,7 @@ import { EVEN_VAR } from "./EventBus.js";
|
|
|
|
|
|
return () => {
|
|
|
// 只读模式:不初始化 Jodit,直接渲染 HTML + 附件按钮 by xu 20250402
|
|
|
- if (isReadonly) {
|
|
|
+ if (props.mode === "play") {
|
|
|
return h("div", { class: "ss-editor-container ss-editor-readonly" }, [
|
|
|
fjid.value &&
|
|
|
h("input", {
|