setNavigationBarTitle
Đặt lại tiêu đề trên thanh điều hướng của trang hiện tại.
Parameters
Object object
| Property | Type | Default | Required | Description | Minimum Version |
|---|---|---|---|---|---|
| title | string | true | Tiêu đề cần đặt cho trang | ||
| success | function | Callback function khi gọi api thành công | |||
| fail | function | Callback 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);
}
};