File tree Expand file tree Collapse file tree 4 files changed +30
-16
lines changed
Expand file tree Collapse file tree 4 files changed +30
-16
lines changed Original file line number Diff line number Diff line change 3636 "axios" : " ^1.7.2" ,
3737 "codemirror" : " ^6.0.2" ,
3838 "crypto-js" : " ^4.2.0" ,
39+ "dompurify" : " ^3.3.1" ,
3940 "echarts" : " ^5.5.0" ,
4041 "element-plus" : " 2.11.9" ,
4142 "fit2cloud-ui-plus" : " ^1.2.3" ,
Original file line number Diff line number Diff line change 1+ <template >
2+ <MdEditor previewOnly v-model =" sanitizedReadMe" :theme =" isDarkTheme ? 'dark' : 'light'" />
3+ </template >
4+
5+ <script lang="ts" setup>
6+ import MdEditor from ' md-editor-v3' ;
7+ import ' md-editor-v3/lib/style.css' ;
8+ import DOMPurify from ' dompurify' ;
9+
10+ import { useGlobalStore } from ' @/composables/useGlobalStore' ;
11+ const { isDarkTheme } = useGlobalStore ();
12+
13+ const props = defineProps ({
14+ content: {
15+ type: String ,
16+ default: ' ' ,
17+ },
18+ });
19+
20+ const sanitizedReadMe = computed (() => {
21+ return DOMPurify .sanitize (props .content );
22+ });
23+ </script >
Original file line number Diff line number Diff line change 3232 <span class =" icon-span" >{{ item.fixCount }}</span >
3333 </template >
3434 <div class =" panel-MdEditor" >
35- <MdEditor v-model =" item.content" previewOnly :theme = " isDarkTheme ? 'dark' : 'light' " />
35+ <MarkDownEditor :content =" item.content" />
3636 </div >
3737 </el-collapse-item >
3838 </div >
5757</template >
5858
5959<script setup lang="ts">
60+ import MarkDownEditor from ' @/components/mkdown-editor/index.vue' ;
61+
6062import { getSettingInfo , listReleases , updateSetting } from ' @/api/modules/setting' ;
61- import MdEditor from ' md-editor-v3' ;
62- import ' md-editor-v3/lib/style.css' ;
6363import { ref } from ' vue' ;
6464import { GlobalStore } from ' @/store' ;
65- import { storeToRefs } from ' pinia' ;
6665import { FormInstance } from ' element-plus' ;
6766import { MsgSuccess } from ' @/utils/message' ;
6867import i18n from ' @/lang' ;
@@ -73,8 +72,6 @@ const mobile = computed(() => {
7372 return globalStore .isMobile ();
7473});
7574
76- const { isDarkTheme } = storeToRefs (globalStore );
77-
7875const drawerVisible = ref (false );
7976const currentVersion = ref (0 );
8077const notes = ref ([]);
Original file line number Diff line number Diff line change 1515 {{ upgradeInfo.testVersion }}
1616 </el-radio >
1717 </el-radio-group >
18- <MdEditor
19- v-loading =" loading"
20- v-model =" upgradeInfo.releaseNote"
21- previewOnly
22- :theme =" isDarkTheme ? 'dark' : 'light'"
23- />
18+ <MarkDownEditor v-loading =" loading" :content =" upgradeInfo.releaseNote" />
2419 </div >
2520 <template #footer >
2621 <span class =" dialog-footer" >
3227</template >
3328
3429<script setup lang="ts">
30+ import MarkDownEditor from ' @/components/mkdown-editor/index.vue' ;
31+
3532import { loadReleaseNotes , upgrade } from ' @/api/modules/setting' ;
36- import MdEditor from ' md-editor-v3' ;
3733import i18n from ' @/lang' ;
38- import ' md-editor-v3/lib/style.css' ;
3934import { MsgSuccess } from ' @/utils/message' ;
4035import { ref } from ' vue' ;
4136import { GlobalStore } from ' @/store' ;
4237import { ElMessageBox } from ' element-plus' ;
43- import { storeToRefs } from ' pinia' ;
4438
4539const globalStore = GlobalStore ();
46- const { isDarkTheme } = storeToRefs (globalStore );
4740
4841const drawerVisible = ref (false );
4942const upgradeInfo = ref ();
You can’t perform that action at this time.
0 commit comments