How to use the @tarojs/taro.setNavigationBarTitle function in @tarojs/taro

To help you get started, we’ve selected a few @tarojs/taro examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github huangjianke / Gitter / src / pages / account / follow.js View on Github external
// Followers
      url = '/user/followers'
      if (username) {
        url = '/users/' + username + '/followers'
      }
      title = 'Followers'
    } else if (type === 'following') {
      // Following
      url = '/user/following'
      if (username) {
        url = '/users/' + username + '/following'
      }
      title = 'Following'
    }

    Taro.setNavigationBarTitle({
      title: title
    })

    this.setState({
      url: url
    })
  }
github SolidZORO / leaa / packages / leaa-miniprogram / src / pages / home / home.tsx View on Github external
componentDidMount() {
    Taro.setNavigationBarTitle({ title: 'leaa-demo' }).then();

    // Taro.switchTab({ url: '/pages/article/article-list' }).then();
    // Taro.navigateTo({ url: '/pages/article/article-item?id=28' }).then();
    // Taro.switchTab({ url: '/pages/account/account' }).then();
  }
github lsqy / taro-music / src / pages / songDetail / index.tsx View on Github external
setSongInfo(songInfo) {
    try {
      const { name, al, url, lrcInfo } = songInfo
      Taro.setNavigationBarTitle({
        title: name
      })
      backgroundAudioManager.title = name
      backgroundAudioManager.coverImgUrl = al.picUrl
      backgroundAudioManager.src = url
      this.setState({
        lrc: lrcInfo,
        isPlaying: true,
        firstEnter: false
      });
    } catch(err) {
      console.log('err', err)
      this.getNextSong()
    }
  }
github EasyTuan / taro-msparis / src / pages / detail / index.js View on Github external
let imgList;
      if (res.data.image) {
        imgList = res.data.image.map(item => {
          return {
            image_src: item,
          };
        });
      } else {
        imgList = [
          {
            image_src:
              'http://static-r.msparis.com/uploads/d/1/d1ca37e902e5550ad2c82c721bc216ce.png',
          },
        ];
      }
      Taro.setNavigationBarTitle({
        title: res.data.name,
      });
      this.setState({
        detail: res.data,
        imageObj: imgList,
        specificationsList: res.data.specifications,
      });
    }
  }
github huangjianke / Gitter / src / pages / git / tutorials.js View on Github external
}, ()=> {
      Taro.setNavigationBarTitle({
        title: this.state.item.title
      })
    })
  }
github SolidZORO / leaa / packages / leaa-miniprogram / src / pages / article / article-list.tsx View on Github external
componentDidMount() {
    Taro.setNavigationBarTitle({ title: '文章列表' }).then();
  }
github huangjianke / Gitter / src / pages / repo / repo.js View on Github external
onPageScroll(e) {
    let title = ''
    const { repo } = this.state
    if (e.scrollTop > 0) {
      title = repo.name
    }
    Taro.setNavigationBarTitle({
      title: title
    })
  }
github Harhao / miniProgram / src / pages / detail / detail.js View on Github external
componentWillMount () {
    let params = this.$router.params;
    let title = params.title;
    Taro.setNavigationBarTitle({
      title:title
    })
    this.setState({
      params:{
        title:params.title,
        id:params.id,
        cityId:params.cityId
      }
    });
  }
github qit-team / taro-yanxuan / src / pages / cate-sub / cate-sub.js View on Github external
this.props.dispatchSubMenu(payload).then((res) => {
      this.setState({ loaded: true })

      const { category: { name, subCategoryList } } = res
      Taro.setNavigationBarTitle({ title: name })
      setTimeout(() => {
        const index = subCategoryList.findIndex(item => item.id === this.subId)
        this.handleMenu(index)
      }, 0)
    })
  }