Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions fe/packages/container/src/pages/miniApp/miniApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -903,17 +903,15 @@ export class MiniApp {
this.tabBarEl = this.el.querySelector('.dimina-mini-app__tabbar')
if (!this.tabBarEl) return

const { color, backgroundColor, borderStyle, list } = this.tabBarConfig
const { color, backgroundColor, list } = this.tabBarConfig
const normalColor = this._sanitizeCssColor(color) || '#999999'
const bg = this._sanitizeCssColor(backgroundColor) || '#ffffff'
const borderColor = borderStyle === 'white' ? '#FFFFFF' : '#E0E0E0'

// 用 DOM API 构建,避免 innerHTML 拼接被配置中的引号 / HTML 片段污染宿主 DOM
this.tabBarEl.textContent = ''
const tabbar = document.createElement('div')
tabbar.className = 'dimina-tabbar'
tabbar.style.backgroundColor = bg
tabbar.style.borderTop = `0.5px solid ${borderColor}`
tabbar.style.backgroundColor = bg;

list.forEach((item, index) => {
const path = this._normalizePagePath(item.pagePath)
Expand Down Expand Up @@ -1162,11 +1160,7 @@ export class MiniApp {
// 2. 更新已渲染的 tabbar DOM(背景 / 边框)
const tabbar = this.tabBarEl.querySelector('.dimina-tabbar')
if (tabbar) {
if (safeBg) tabbar.style.backgroundColor = safeBg
if (validBorderStyle) {
const borderColor = validBorderStyle === 'white' ? '#FFFFFF' : '#E0E0E0'
tabbar.style.borderTop = `0.5px solid ${borderColor}`
}
if (safeBg) tabbar.style.backgroundColor = safeBg;
}

// 3. 文字颜色按当前选中态重新刷一遍(同时处理 color 和 selectedColor)
Expand Down
Loading