setNavigationBarLeftButton
Đặt lại nút bên trái trên thanh điều hướng của trang hiện tại.
Parameters
Object object
Property | Type | Default | Required | Description | Minimum Version |
---|---|---|---|---|---|
type | string | back | true | Nhận 1 trong các giá trị sau: "none": không hiển thị. "back": hiển thị nút trở lại. "home": hiển thị nút trang chủ. "both": hiển thị cả 2. | |
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.setNavigationBarLeftButton({
type: 'both',
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.setNavigationBarLeftButton({
type: 'both'
});
} catch (error) {
// xử lý khi gọi api thất bại
console.log(error);
}
};