当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
QT之鼠标和键盘事件重写
mysql-installer安装教程(详细图文)
15【背景 渐变色】
05-分布式计算框架
uniapp中动态修改导航栏标题
# RACE32——高级断点的设置和应用
compose 位移视图
Jmeter TCP/UDP测试
vs studio install opencv environment
记录学习--Navicat使用自定义数据库列表
【GO记录】从零开始GO语言——用GO语言做一个示波器(二)基于arduino的简易示波器
重定向printf到USB CDC、串口2
流程图(1)
LVS负载均衡群集及部署LVS-NAT实验
ROS通信模块:秒懂话题通信
IPv4编址;A类、B类、C类、D类、E类IP地址(IP地址;网络地址和主机地址;子网掩码;网关;广播地址;)
ClickHouse数据类型
IDEA如何创建父子工程
vant-field中colon属性为true报错
Scala基础【异常、隐式转换、泛型】









