editor chat
This commit is contained in:
parent
954943a750
commit
f668f4b738
1 changed files with 5 additions and 3 deletions
|
|
@ -2,8 +2,8 @@
|
||||||
import { onMounted, inject, ref, nextTick, watch } from "vue";
|
import { onMounted, inject, ref, nextTick, watch } from "vue";
|
||||||
import { useLocalChatStore } from "@/stores/localchat";
|
import { useLocalChatStore } from "@/stores/localchat";
|
||||||
import { formatChatTime } from "@/util/common";
|
import { formatChatTime } from "@/util/common";
|
||||||
import Vditor from "vditor";
|
// import Vditor from "vditor";
|
||||||
import "vditor/dist/index.css";
|
// import "vditor/dist/index.css";
|
||||||
import { ElScrollbar } from "element-plus";
|
import { ElScrollbar } from "element-plus";
|
||||||
import { System } from "@/system";
|
import { System } from "@/system";
|
||||||
const sys:any = inject<System>("system");
|
const sys:any = inject<System>("system");
|
||||||
|
|
@ -38,7 +38,9 @@ watch(
|
||||||
);
|
);
|
||||||
function replaceIconTags(text:any) {
|
function replaceIconTags(text:any) {
|
||||||
// 定义正则表达式,匹配 {*任意内容*} 的格式
|
// 定义正则表达式,匹配 {*任意内容*} 的格式
|
||||||
text = Vditor.md2html(text);
|
// console.log(text)
|
||||||
|
// text = Vditor.md2html(text);
|
||||||
|
// console.log(text)
|
||||||
const regex = /\{\-(.*?)\-\}/g;
|
const regex = /\{\-(.*?)\-\}/g;
|
||||||
|
|
||||||
// 使用正则表达式的replace方法进行替换
|
// 使用正则表达式的replace方法进行替换
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue