mirror of
https://github.com/HiMeditator/auto-caption.git
synced 2026-02-14 11:34:43 +08:00
feat: 更新 README 并添加清空字幕记录功能
- 更新 README 中的项目状态和下载链接 - 添加清空字幕记录的功能 - 优化字幕记录的导出和清空界面 - 更新代码以支持跨平台兼容性 - 添加开源协议
This commit is contained in:
@@ -34,11 +34,18 @@
|
||||
<span style="margin-right: 30px;">字幕记录</span>
|
||||
<a-button
|
||||
type="primary"
|
||||
style="margin-right: 20px;"
|
||||
@click="exportCaptions"
|
||||
:disabled="captionData.length === 0"
|
||||
>
|
||||
导出字幕记录
|
||||
</a-button>
|
||||
<a-button
|
||||
danger
|
||||
@click="clearCaptions"
|
||||
>
|
||||
清空字幕记录
|
||||
</a-button>
|
||||
</div>
|
||||
<a-table
|
||||
:columns="columns"
|
||||
@@ -128,6 +135,10 @@ function exportCaptions() {
|
||||
document.body.removeChild(a)
|
||||
URL.revokeObjectURL(url)
|
||||
}
|
||||
|
||||
function clearCaptions() {
|
||||
captionLog.clear()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -21,11 +21,17 @@ export const useCaptionLogStore = defineStore('captionLog', () => {
|
||||
}
|
||||
})
|
||||
|
||||
function clear() {
|
||||
captionData.value = []
|
||||
window.electron.ipcRenderer.send('control.caption.clear')
|
||||
}
|
||||
|
||||
window.electron.ipcRenderer.on('both.log.set', (_, logs) => {
|
||||
captionData.value = logs
|
||||
})
|
||||
|
||||
return {
|
||||
captionData
|
||||
captionData,
|
||||
clear
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user