@@ -14,6 +14,19 @@ const releaseDialog = ref(false)
1414// 最新版本
1515const latestRelease = ref (' ' )
1616
17+ // 变更日志对话框标题
18+ const releaseDialogTitle = ref (' ' )
19+
20+ // 变更日志对话框内容
21+ const releaseDialogBody = ref (' ' )
22+
23+ // 打开日志对话框
24+ function showReleaseDialog(title : string , body : string ) {
25+ releaseDialogTitle .value = title
26+ releaseDialogBody .value = body .replaceAll (' \r\n ' , ' <br />' )
27+ releaseDialog .value = true
28+ }
29+
1730// 查询系统环境变量
1831async function querySystemEnv() {
1932 try {
@@ -176,7 +189,7 @@ onMounted(() => {
176189 </h3 >
177190 <div class =" section space-y-3" >
178191 <div >
179- <div v-for =" release in allRelease" :key =" release.tag_name" class =" flex w-full flex-col space-y-3 rounded-md px-4 py-2 shadow-md ring-1 ring-gray-400 sm:flex-row sm:space-y-0 sm:space-x-3" >
192+ <div v-for =" release in allRelease" :key =" release.tag_name" class =" mb-3 flex w-full flex-col space-y-3 rounded-md px-4 py-2 shadow-md ring-1 ring-gray-400 sm:flex-row sm:space-y-0 sm:space-x-3" >
180193 <div class =" flex w-full flex-grow items-center justify-start space-x-2 truncate sm:justify-start" >
181194 <span class =" truncate text-lg font-bold" >
182195 <span class =" mr-2 whitespace-nowrap text-xs font-normal" >{{ releaseTime(release.published_at) }}</span >
@@ -189,30 +202,27 @@ onMounted(() => {
189202 当前版本
190203 </span >
191204 </div >
192- <VDialog v-model =" releaseDialog" width =" 600" scrollable >
193- <template #activator =" { props } " >
194- <VBtn v-bind =" props" >
195- <template #prepend >
196- <VIcon icon =" mdi-text-box-outline" />
197- </template >
198- 查看变更日志
199- </VBtn >
205+ <VBtn @click.stop =" showReleaseDialog(release.tag_name, release.body)" >
206+ <template #prepend >
207+ <VIcon icon =" mdi-text-box-outline" />
200208 </template >
201- <VCard :title =" `${release.tag_name} 变更日志`" >
202- <VCardItem >
203- <DialogCloseBtn @click =" releaseDialog = false" />
204- </VCardItem >
205- <VCardText >
206- {{ release.body }}
207- </VCardText >
208- </VCard >
209- </VDialog >
209+ 查看变更日志
210+ </VBtn >
210211 </div >
211212 </div >
212213 </div >
213214 </div >
214215 </div >
215216 </div >
217+ <VDialog v-model =" releaseDialog" width =" 600" scrollable >
218+ <VCard >
219+ <VCardItem >
220+ <DialogCloseBtn @click =" releaseDialog = false" />
221+ <VCardTitle >{{ releaseDialogTitle }} 变更日志</VCardTitle >
222+ </VCardItem >
223+ <VCardText v-html =" releaseDialogBody" />
224+ </VCard >
225+ </VDialog >
216226</template >
217227
218228<style type="scss">
0 commit comments