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