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: "职位详情"
        })
    }

}    

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM