直接上代码
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 结果如何都会执行的代码块
}