Taro设置顶部标题文字

实现如图所示:

 

 

方法一:

在文件夹中建立,xxxx.config.js或xxxx.config.ts然后在文件中写

export default {
  navigationBarTitleText: "职位详情",
};
 
 
方法二:在当前要设置的页面的jsx或tsx中添加
import Taro, { Config } from "@tarojs/taro"


export default class JobDetail extends Component<any, any> {
    config = {
        navigationBarTitleText: '职位详情'
    }
    constructor(props) {}

        componentWillMount() {
        Taro.setNavigationBarTitle({
            title: "职位详情"
        })
    }

}    

 

 
posted @ 2020-08-07 15:20  墨染清浅  阅读(3065)  评论(0)    收藏  举报