Nhảy tới nội dung

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

PropertyTypeDefaultRequiredDescriptionMinimum Version
typestringbacktrueNhậ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.
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.setNavigationBarLeftButton({
type: "back",
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: "back",
});
} catch (error) {
// xử lý khi gọi api thất bại
console.log(error);
}
};