|
@@ -14,10 +14,10 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script lang="ts" setup name="wngEditor">
|
|
|
-import '@wangeditor-next/editor/dist/css/style.css' // 引入 css
|
|
|
+import '@wangeditor-next/editor/dist/css/style.css'; // 引入 css
|
|
|
import { onBeforeUnmount, reactive, shallowRef, watch, nextTick, ref } from 'vue';
|
|
|
-import { IDomEditor } from '@wangeditor-next/editor'
|
|
|
-import { Editor, Toolbar } from '@wangeditor-next/editor-for-vue'
|
|
|
+import { IDomEditor } from '@wangeditor-next/editor';
|
|
|
+import { Editor, Toolbar } from '@wangeditor-next/editor-for-vue';
|
|
|
import { Cookie } from '@/utils/storage';
|
|
|
import { uploadFile } from '@/api/public/upload';
|
|
|
import { ElMessage } from 'element-plus';
|
|
@@ -62,12 +62,9 @@ const state = reactive<any>({
|
|
|
editorConfig: {
|
|
|
placeholder: props.placeholder,
|
|
|
MENU_CONF: {},
|
|
|
- hoverbarKeys:{
|
|
|
-
|
|
|
- },
|
|
|
+ hoverbarKeys: {},
|
|
|
},
|
|
|
editorVal: props.getHtml,
|
|
|
-
|
|
|
});
|
|
|
const toolConfig = ref({
|
|
|
excludeKeys: [
|
|
@@ -152,6 +149,26 @@ state.editorConfig.MENU_CONF['fontSize'] = {
|
|
|
'48px',
|
|
|
],
|
|
|
};
|
|
|
+// 字体
|
|
|
+state.editorConfig.MENU_CONF['fontFamily'] = {
|
|
|
+ fontFamilyList: [
|
|
|
+ // 字符串形式
|
|
|
+ '黑体',
|
|
|
+ '仿宋',
|
|
|
+ '楷体',
|
|
|
+ '标楷体',
|
|
|
+ '华文仿宋',
|
|
|
+ '华文楷体',
|
|
|
+ '宋体',
|
|
|
+ '微软雅黑',
|
|
|
+ 'Arial',
|
|
|
+ 'Tahoma',
|
|
|
+ 'Verdana',
|
|
|
+ 'Times New Roman',
|
|
|
+ 'Courier New',
|
|
|
+ '字体仿宋-GB2312',
|
|
|
+ ],
|
|
|
+};
|
|
|
// 默认字体
|
|
|
/*const defaultContent =ref([
|
|
|
{
|