|
@@ -156,11 +156,7 @@
|
|
|
editorRef.setHtml(html);
|
|
|
}
|
|
|
"
|
|
|
- :setisupText="
|
|
|
- bool => {
|
|
|
- isupText = bool;
|
|
|
- }
|
|
|
- "
|
|
|
+ :setisupText="bool => (isupText = bool)"
|
|
|
:html="() => editorRef.getHtml()"
|
|
|
:text="() => editorRef.getText()"
|
|
|
:is="component_list[select_right_btn_type]"
|
|
@@ -231,7 +227,7 @@ import '@wangeditor/editor/dist/css/style.css'; // 引入 css
|
|
|
import { onBeforeUnmount, ref, shallowRef, onMounted } from 'vue';
|
|
|
import { Editor, Toolbar } from '@wangeditor/editor-for-vue';
|
|
|
import { advertisement, generate_pc_get, getSID } from '@/api/aleditor.js';
|
|
|
-import { Boot } from '@wangeditor/editor'
|
|
|
+import { Boot } from '@wangeditor/editor';
|
|
|
// 右侧一级组件
|
|
|
import pen_ink from './components/pen_ink.vue';
|
|
|
import review from './components/review.vue';
|
|
@@ -256,14 +252,14 @@ import poetry from './components/poetry.vue';
|
|
|
import novel from './components/novel.vue';
|
|
|
import composition from './components/composition.vue';
|
|
|
import continuation from './components/continuation.vue';
|
|
|
-import ClearMenu from "./components/clearMenu";
|
|
|
+import ClearMenu from './components/clearMenu';
|
|
|
|
|
|
const menu = {
|
|
|
- key:'clear',
|
|
|
- factory(){
|
|
|
- return new ClearMenu();
|
|
|
- }
|
|
|
-}
|
|
|
+ key: 'clear',
|
|
|
+ factory() {
|
|
|
+ return new ClearMenu();
|
|
|
+ },
|
|
|
+};
|
|
|
Boot.registerMenu(menu);
|
|
|
// 右侧头部数据
|
|
|
const right_head = ref({});
|
|
@@ -360,7 +356,7 @@ const select_right_btn_list = ref([
|
|
|
|
|
|
onMounted(() => {});
|
|
|
|
|
|
-let isupText = false;
|
|
|
+let isupText = ref(false);
|
|
|
const statusPage = ref([false, true]); // 0 --> 目录 1 --> operate
|
|
|
const load = ref(false);
|
|
|
const toolShow = ref(true);
|
|
@@ -402,7 +398,7 @@ const toolbarConfig = {
|
|
|
'headerSelect',
|
|
|
'bulletedList',
|
|
|
'numberedList',
|
|
|
- 'clear'
|
|
|
+ 'clear',
|
|
|
],
|
|
|
};
|
|
|
const editorConfig = {
|
|
@@ -420,7 +416,7 @@ const editorConfig = {
|
|
|
};
|
|
|
|
|
|
const contentChange = () => {
|
|
|
- if (isupText) return;
|
|
|
+ if (isupText.value) return;
|
|
|
try {
|
|
|
if (!window.getSelection()) return;
|
|
|
const s = window.getSelection().getRangeAt(0);
|
|
@@ -503,7 +499,7 @@ const setHtml = html => {
|
|
|
let list = html.split('');
|
|
|
if (isEm) ot = '';
|
|
|
let h = '';
|
|
|
- isupText = true;
|
|
|
+ isupText.value = true;
|
|
|
let t = setInterval(() => {
|
|
|
if (list[0] === '<' && list[1] === '/') {
|
|
|
let isNext = true;
|
|
@@ -523,7 +519,7 @@ const setHtml = html => {
|
|
|
|
|
|
editorRef.value.setHtml(ot + '<p>' + h + '</p>');
|
|
|
if (!list.length) {
|
|
|
- isupText = false;
|
|
|
+ isupText.value = false;
|
|
|
load.value = false;
|
|
|
clearInterval(t);
|
|
|
}
|