實現如圖所示:
方法一:
在文件夾中建立,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: "職位詳情" }) } }