当前位置:网站首页>Dynamically modify the title of the navigation bar in uniapp
Dynamically modify the title of the navigation bar in uniapp
2022-08-03 03:33:00 【The angel of similar】
uniappDynamically modify the navigation bar title in
使用场景:从A页面跳转至B页面,在APages have multiple message types,跳转BThe page displays a different navigation bar title,如视频所示:
A页面代码如下:
onClick(type) {
uni.navigateTo({
url: `./messageDetails?type=` + type
})
},
B页面代码如下:
<template>
<view class="container">
<text>{
{
text}}</text>
</view>
</template>
<script>
export default {
data() {
return {
text: ''
}
},
onLoad(options) {
if (options.type == 1) {
this.text = '消息通知'
uni.setNavigationBarTitle({
title: '消息通知'
});
} else if (options.type == 2) {
this.text = '互动消息'
uni.setNavigationBarTitle({
title: '互动消息'
});
} else if (options.type == 3) {
this.text = '系统消息'
uni.setNavigationBarTitle({
title: '系统消息'
});
} else if (options.type == 4) {
this.text = '其他'
uni.setNavigationBarTitle({
title: '其他'
});
}
},
methods: {
}
}
</script>
<style lang="scss">
.container {
padding: 0;
margin: 0;
}
</style>
Who we were does not dictate who we will be
边栏推荐
- Go新项目-编译项目的细节(4)
- mysql-installer安装教程(详细图文)
- 【云原生】服务行业案例-不可预测的并发场景解决方案
- 金仓数据库 OCCI 迁移指南(5. 程序开发示例)
- AttributeError: module ‘xxx‘ has no attribute
- [@property enhancement in Objective-C language]
- 金仓数据库 Pro*C 迁移指南( 4. KingbaseES 的 Pro*C 迁移指南)
- JS高级 之 Proxy-Reflect 使用详解
- 征集 |《新程序员》专访“Apache之父”Brian Behlendorf,你最想问什么?
- 信号和槽的绑定
猜你喜欢
随机推荐
HCIP第十八天
爆肝22个ES6知识点
机器学习【KNN案例、API、总结】
Auto.js Pro 计算脚本运行时间
大佬们,我有点不明白:为什么oracle-cdc的文档写connector可以做到exactly-o
通过kubernetes可视化界面(rancher)安装kibana
MySQL-Explain详解
IPv4编址;A类、B类、C类、D类、E类IP地址(IP地址;网络地址和主机地址;子网掩码;网关;广播地址;)
详细讲解一下JVM的内存模型与实现?
QWidget、QPushButton、
Topic Modeling of Short Texts: A Pseudo-Document View
C语言实验十一 指针(一)
信号和槽的绑定
ClickHouse—高级
堆的应用:堆排序和TOP-K问题
什么样的存储服务,才能成为企业数字化创新“加速器”?
【TA-霜狼_may-《百人计划》】先行部分 手搓视差体积云
部门之间,互不信任正常吗?(你是否遇到过)
【数据分析】基于MATLAB实现SVDD决策边界可视化
ClickHouse数据类型









