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 api from 'zmp-sdk';

api.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
const test = async () => {
try {
await api.setNavigationBarTitle({
title: 'My App'
});
} catch (error) {
// xử lý khi gọi api thất bại
console.log(error);
}
};