小程序开发 | 详情页面的"navigationBarTitleText": ""应该如何设置?

发布于 7 年前作者 jingzhong6732 次浏览最后编辑 7 年前来自 ask

"navigationBarTitleText": ""

wx.setNavigationBarTitle({

          title: "{{line}}"

上面是我写的,上一面传过来数据line,我现在想要把{{line}}作为详情页面的标题

 let line = options.line;

 let date = options.date;

      if(line && date){

        this.setData({

          line,

          date

        })

      };

         var that = this

         let key = that.data.line;

好像都不起作用,请问应该如何解决,谢谢!

2 回复
zpan
zpan1 楼5 年前
wx.setNavigationBarTitle({
  title: this.data.line
})
yang79
yang792 楼5 年前
//设置标题
wx.setNavigationBarTitle({
  title: this.data.line
})
console.log(this.data.line)