当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
Interconversion between numpy PIL tensors
用 SQL 做数据分析的十大常用功能,附面试原题解答!!
ROS通信模块:秒懂话题通信
任意版本JLink驱动官方下载指引
【Arduino】重生之Arduino 学僧(3)----Arduino函数
els 计分
大佬们,我有点不明白:为什么oracle-cdc的文档写connector可以做到exactly-o
ClickHouse数据类型
leetcode:153. 寻找旋转排序数组中的最小值
问下有用sql server flink-sql-connector-sqlserver-cdc-2
MySQL-Explain详解
nVisual信息基础设施可视化管理
信号和槽的绑定
韦东山 数码相框 项目学习(五)libjpeg-turbo的移植
Go新项目-编译项目的细节(4)
Auto.js Pro 编写第一个脚本hello world
The LVS load balancing cluster and the deployment of the LVS - NAT experiment
C语言实验十二 指针(二)
AttributeError: module ‘xxx‘ has no attribute
radio button、qss文件环境配置