feat: 添加日志导出功能
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user