当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
Topic Modeling of Short Texts: A Pseudo-Document View
Fiddler基本使用
The LVS load balancing cluster and the deployment of the LVS - NAT experiment
韦东山 数码相框 项目学习(五)libjpeg-turbo的移植
WordPress博客问答小插件
vsftp容器搭建+go开发web用户管理界面(更新于2022.02.23)
Kotlin 乘法、我怎么越乘越小?
Redshift贴logo的方法
关于 Redis 必问面试题,你知道哪些?
Nacos入门学习
Methods annotated with ‘@Async‘ must be overridable
kubernetes部署ldap
【云原生】阿里云ARMS业务实时监控
用 SQL 做数据分析的十大常用功能,附面试原题解答!!
QT之鼠标和键盘事件重写
leetcode:139. 单词拆分
How does Excel compare if two columns of strings are the same?
企业上云规划与云原生环境设计
Disable the token and update the token function without awareness
ClickHouse数据类型









