提交修改
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
const app = getApp()
|
||||
|
||||
Component({
|
||||
properties: {
|
||||
active: { type: String, value: 'home' },
|
||||
themeMode: { type: String, value: 'light' },
|
||||
tabs: {
|
||||
type: Array,
|
||||
value: [
|
||||
@@ -10,6 +13,11 @@ Component({
|
||||
],
|
||||
},
|
||||
},
|
||||
lifetimes: {
|
||||
attached() {
|
||||
this.setData({ themeMode: app.globalData.themeMode })
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
onSwitch(e) {
|
||||
this.triggerEvent('switch', { key: e.currentTarget.dataset.key })
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<view class="nav-bar">
|
||||
<view data-theme="{{themeMode}}" class="nav-bar">
|
||||
<view wx:for="{{tabs}}" wx:key="key" class="nav-item" data-key="{{item.key}}" bindtap="onSwitch">
|
||||
<text class="nav-icon">{{item.icon}}</text>
|
||||
<text class="nav-label {{active===item.key?'active':''}}">{{item.label}}</text>
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
padding: 8px 0 24px;
|
||||
border-top: 0.5px solid #E5E5EA;
|
||||
background: rgba(245,245,247,0.95);
|
||||
border-top: 0.5px solid var(--color-border);
|
||||
background: var(--color-nav-bg);
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
@@ -20,5 +20,5 @@
|
||||
padding: 4px;
|
||||
}
|
||||
.nav-icon { font-size: 22px; }
|
||||
.nav-label { font-size: 10px; color: #86868B; }
|
||||
.nav-label.active { color: #FF6B35; font-weight: 600; }
|
||||
.nav-label { font-size: 10px; color: var(--color-text-secondary); }
|
||||
.nav-label.active { color: var(--color-primary); font-weight: 600; }
|
||||
Reference in New Issue
Block a user