uniapp 动态修改页面标题

直接上代码

uni.setNavigationBarTitle()

			try{
    
    
				if(option.from == 'case'){
    
    
					this.type = 1
					uni.setNavigationBarTitle({
    
    
					  title: '案例详情'
					})
				} else {
    
    
					this.type = 0
				}
			}catch(e){
    
    
				//TODO handle the exception
			}

在这里插入图片描述

题外话

complete 参数 有点类似 try catch finally 中的 finally

try {
    
    
    tryCode - 尝试执行代码块
}
catch(err) {
    
    
    catchCode - 捕获错误的代码块
}
finally {
    
    
    finallyCode - 无论 try / catch 结果如何都会执行的代码块
}

猜你喜欢

转载自blog.csdn.net/hu1628299958/article/details/114680773
今日推荐