In actual project development, generally the title text of our page navigation bar is not fixed, but is dynamically set according to the needs of the scene. How to implement this. The methods officially provided by WeChat are as follows:
1. Set up dynamic
onLoad: function (options) {
wx.setNavigationBarTitle({
title: options.name }) // options.name表示上个页面传过来的文字
},
2. Direct setting
onLoad: function (options) {
wx.setNavigationBarTitle({
title: '我要出租' })
},
We can choose according to our own project needs.
Reference article: https://blog.csdn.net/weixin_40967353/article/details/115300337