微信小程序修改页面标题 一时失言乱红尘 2022-05-09 04:28 259阅读 0赞 Page({ data: {}, onLoad: function (options) { var that = this; that.setData({ mername: options.mername//options为页面路由过程中传递的参数 }) wx.setNavigationBarTitle({ title: that.data.mername//页面标题为路由参数 }) }, onReady: function () { // 页面渲染完成 }, onShow: function () { // 页面显示 }, onHide: function () { // 页面隐藏 }, onUnload: function () { // 页面关闭 } }) 主要是这个API:wx.setNavigationBarTitle 或者在json文件中加入 { "navigationBarTitleText": "满减区" } 两种方式,一种动态修改、一种固定。 小程序文档:[https://developers.weixin.qq.com/miniprogram/dev/api/ui/navigation-bar/wx.setNavigationBarTitle.html][https_developers.weixin.qq.com_miniprogram_dev_api_ui_navigation-bar_wx.setNavigationBarTitle.html] 转载地址:[https://blog.csdn.net/m0\_37893932/article/details/70155310][https_blog.csdn.net_m0_37893932_article_details_70155310] [https_developers.weixin.qq.com_miniprogram_dev_api_ui_navigation-bar_wx.setNavigationBarTitle.html]: https://developers.weixin.qq.com/miniprogram/dev/api/ui/navigation-bar/wx.setNavigationBarTitle.html [https_blog.csdn.net_m0_37893932_article_details_70155310]: https://blog.csdn.net/m0_37893932/article/details/70155310
还没有评论,来说两句吧...