js: add navbar set center api
This commit is contained in:
1
doric-js/lib/src/native/navbar.d.ts
vendored
1
doric-js/lib/src/native/navbar.d.ts
vendored
@@ -8,4 +8,5 @@ export declare function navbar(context: BridgeContext): {
|
||||
setBgColor: (color: Color) => Promise<any>;
|
||||
setLeft: (view: View) => Promise<any>;
|
||||
setRight: (view: View) => Promise<any>;
|
||||
setCenter: (view: View) => Promise<any>;
|
||||
};
|
||||
|
@@ -31,6 +31,13 @@ export function navbar(context) {
|
||||
panel.addHeadView("navbar_right", view);
|
||||
}
|
||||
return context.callNative('navbar', 'setRight', view.toModel());
|
||||
}
|
||||
},
|
||||
setCenter: (view) => {
|
||||
if (panel) {
|
||||
panel.clearHeadViews("navbar_center");
|
||||
panel.addHeadView("navbar_center", view);
|
||||
}
|
||||
return context.callNative('navbar', 'setCenter', view.toModel());
|
||||
},
|
||||
};
|
||||
}
|
||||
|
@@ -48,7 +48,8 @@ export class List extends Superview {
|
||||
}
|
||||
}
|
||||
scrollToItem(context, index, config) {
|
||||
const animated = config === null || config === void 0 ? void 0 : config.animated;
|
||||
var _a;
|
||||
const animated = (_a = config) === null || _a === void 0 ? void 0 : _a.animated;
|
||||
return this.nativeChannel(context, 'scrollToItem')({ index, animated, });
|
||||
}
|
||||
reset() {
|
||||
|
Reference in New Issue
Block a user