Nhảy tới nội dung

setNavigationBarTitle

Đặt lại tiêu đề trên thanh điều hướng của trang hiện tại.

Parameters​

Object object​

PropertyTypeDefaultRequiredDescriptionMinimum Version
titlestringtrueTiêu đề cần đặt cho trang
successfunctionCallback function khi gọi api thành công
failfunctionCallback function khi gọi api thất bại

Sample Code​

import { setNavigationBarTitle } from "zmp-sdk/apis";

setNavigationBarTitle({
title: "My App",
success: (res) => {
// xử lý khi gọi api thành công
},
fail: (error) => {
// xử lý khi gọi api thất bại
console.log(error);
}
});

Hoặc

import { setNavigationBarTitle } from "zmp-sdk/apis";

const setTitle = async () => {
try {
await setNavigationBarTitle({
title: "My App"
});
} catch (error) {
// xử lý khi gọi api thất bại
console.log(error);
}
};