feat: 添加日志导出功能

This commit is contained in:
dmy
2026-03-03 14:26:58 +08:00
parent 02bfcc18e4
commit 3b590f9a1f
3 changed files with 97 additions and 1 deletions

View File

@@ -67,11 +67,17 @@ const clearLog = () => {
logs.value = []
}
// 获取日志文本
const getLogsText = (): string => {
return logs.value.map(log => `[${log.time}] [${log.level.toUpperCase()}] ${log.message}`).join('\n')
}
// 暴露方法给父组件
defineExpose({
addLog,
clearLog,
lastTripRates
lastTripRates,
getLogsText
})
</script>