提交 061d614a 编写于 作者: M mehaotian

fix: navbar-lite 删除定时器,优化页面示例

上级 1f0b1e73
...@@ -64,13 +64,10 @@ ...@@ -64,13 +64,10 @@
this.statusBarHeight = statusBarHeight; this.statusBarHeight = statusBarHeight;
}, },
mounted() { mounted() {
// TODO 暂时加定时器,否则不生效 uni.setNavigationBarColor({
setTimeout(() => { frontColor: "#000000",
uni.setNavigationBarColor({ backgroundColor: "#ffffff",
frontColor: "#000000", });
backgroundColor: "#ffffff",
});
}, 100);
}, },
methods: { methods: {
back() { back() {
...@@ -89,7 +86,6 @@ ...@@ -89,7 +86,6 @@
} }
.uni-navbar { .uni-navbar {
/* border: 1px #eee solid; */
background-color: #007aff; background-color: #007aff;
} }
......
...@@ -4,19 +4,20 @@ ...@@ -4,19 +4,20 @@
<scroll-view class="scroll-view" scroll-y="true"> <scroll-view class="scroll-view" scroll-y="true">
<view class="content-item" @click="onClick"> <view class="content-item" @click="onClick">
<text>点击此处,将标题切换为{{isLeft?'居中':'左侧'}}显示</text> <text>点击此处,将标题切换为{{isLeft?'居中':'左侧'}}显示</text>
</view> </view>
<view class="content-item" @tap="setNavigationBarColor1">
<text>设置自定义导航栏前景色白色</text>
</view>
<view class="content-item" @tap="setNavigationBarColor2">
<text>设置自定义导航栏前景色黑色</text>
</view>
<view class="content-item" v-for="item in 100"> <view class="content-item" v-for="item in 100">
<text class="text">内容:{{item}}</text> <text class="text">内容:{{item}}</text>
</view> </view>
<input/> <!-- <input/> -->
<view class="uni-padding-wrap uni-common-mt">
<button @tap="setNavigationBarColor1" class="uni-btn">
设置自定义导航栏前景色白色
</button>
<button @tap="setNavigationBarColor2" class="uni-btn">
设置自定义导航栏前景色黑色
</button>
</view>
</scroll-view> </scroll-view>
</view> </view>
</template> </template>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册