chore: deploy model from local path

This commit is contained in:
jialin
2024-11-07 17:35:07 +08:00
parent 8bc67b323c
commit 93a6a77c2b
15 changed files with 270 additions and 77 deletions
+16 -1
View File
@@ -68,6 +68,7 @@ export default function useOverlayScroller(options?: any) {
instanceRef.current?.update?.();
}, [scrollEventElement.current, instanceRef.current]);
// scroll to bottom
const throttledUpdateScrollerPosition = React.useCallback(
(delay?: number) => {
if (delay === 0) {
@@ -79,6 +80,19 @@ export default function useOverlayScroller(options?: any) {
[throttledScroll, scrollauto]
);
// scroll to top
const updateScrollerPositionToTop = React.useCallback(() => {
console.log(
' scrollEventElement.current.scrollHeight====',
scrollEventElement.current.scrollHeight
);
scrollEventElement.current?.scrollTo?.({
top: 0,
behavior: 'auto'
});
instanceRef.current?.update?.();
}, [scrollEventElement.current, instanceRef.current]);
const generateInstance = () => {
instanceRef.current = instance?.();
scrollEventElement.current =
@@ -114,6 +128,7 @@ export default function useOverlayScroller(options?: any) {
scrollEventElement: scrollEventElement.current,
initialized: initialized.current,
generateInstance,
updateScrollerPosition: throttledUpdateScrollerPosition
updateScrollerPosition: throttledUpdateScrollerPosition,
updateScrollerPositionToTop: updateScrollerPositionToTop
};
}