@@ -65,32 +65,31 @@ const { open, like, resetLike } = useLike()
6565
6666const defInfo = reactive ({ path: ' ' })
6767
68- onBeforeMount (async () => {
69- defInfo .path = await getPath ()
70- })
71-
72- const getPath = async (): Promise <string > => {
68+ onBeforeMount (() => {
7369 const query = new URLSearchParams (window .location .search ).get (' path' ) || ' '
7470 if (query ) {
75- return query
71+ defInfo .path = query
72+ } else {
73+ inputPath (true )
7674 }
75+ })
7776
78- return inputPath ()
79- }
80-
81- const inputPath = async () => {
77+ const inputPath = async (force ? : boolean ) => {
8278 return await ElMessageBox .prompt (
8379 ' 部分文件可在文件管理中双击文件进行编辑,详见应用介绍' ,
8480 ' 请输入文件路径' ,
8581 {
82+ showClose: false ,
83+ closeOnClickModal: false ,
84+ closeOnPressEscape: false ,
85+ closeOnHashChange: false ,
86+ showCancelButton: ! force ,
8687 confirmButtonText: ' 确认' ,
8788 cancelButtonText: ' 取消' ,
8889 },
8990 ).then (({ value }) => {
9091 if (value ) {
91- return defInfo .path = value
92- } else {
93- return value
92+ defInfo .path = value
9493 }
9594 })
9695}
@@ -103,6 +102,17 @@ body,
103102 height : 100% ;
104103}
105104
105+ html {
106+ & .dark {
107+ #app {
108+ > .header ,
109+ > .footer {
110+ background-color : #1c1c1c ;
111+ }
112+ }
113+ }
114+ }
115+
106116#app {
107117 height : 100% ;
108118 display : flex ;
@@ -114,7 +124,6 @@ body,
114124 display : flex ;
115125 align-items : center ;
116126 gap : 4px ;
117- background-color : #1c1c1c ;
118127 padding : 0 12px ;
119128
120129 > * {
@@ -123,22 +132,22 @@ body,
123132 }
124133
125134 > .header {
126- border-bottom : solid 1px rgba ( 255 , 255 , 255 , 0.2 );
135+ border-bottom : solid 1px var ( --el-border-color );
127136
128137 > .title {
129138 font-size : 14px ;
130139 line-height : 32px ;
131- color : #fff ;
140+ color : var ( --el-text-color-primary ) ;
132141 }
133142 }
134143
135144 > .footer {
136- border-top : solid 1px rgba ( 255 , 255 , 255 , 0.2 );
145+ border-top : solid 1px var ( --el-border-color );
137146
138147 > .developed {
139148 font-size : 12px ;
140149 line-height : 32px ;
141- color : gray ;
150+ color : var ( --el-text-color-placeholder ) ;
142151 }
143152 }
144153
0 commit comments