diff --git a/pages/demo/index.vue b/pages/demo/index.vue index c699eb5..599bcf6 100644 --- a/pages/demo/index.vue +++ b/pages/demo/index.vue @@ -128,12 +128,27 @@ - 消息日志 + + 消息日志 + + + + + 暂无消息日志 + { + if (res.confirm) { + this.messageLogs = [] + uni.showToast({ + title: '日志已清空', + icon: 'success', + duration: 1500 + }) + } + } + }) + }, + // 添加日志 addLog(type, topic, message) { const time = new Date().toLocaleTimeString() @@ -443,6 +476,14 @@ export default { margin-bottom: 15px; } +/* 日志区域标题容器 - 包含标题和清空按钮 */ +.section-title-wrapper { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 15px; +} + .section-title { font-size: 16px; font-weight: bold; @@ -452,6 +493,13 @@ export default { padding-bottom: 8px; } +/* 清空日志按钮样式 */ +.clear-log-btn { + height: 30px; + line-height: 30px; + padding: 0 10px; +} + .form-item { display: flex; flex-direction: column; @@ -561,6 +609,14 @@ export default { padding: 10px; } +/* 空日志提示 */ +.empty-log-tip { + text-align: center; + color: #999; + padding: 20px 0; + font-size: 14px; +} + .log-item { padding: 8px; border-bottom: 1px solid #eee;