Files
bw-mini-app/src/hooks/useUploadVideo.ts
2025-09-03 15:57:27 +08:00

20 lines
459 B
TypeScript

import { useReady } from '@tarojs/taro';
import Taro from '@tarojs/taro';
interface UploadOptions {
errMsg?: string;
[key: string]: any;
}
export const useUploadVideo = (
onUpload: (options: UploadOptions) => void
) => {
useReady(() => {
const pages = Taro.getCurrentPages();
const currentPage = pages[pages.length - 1];
if (currentPage) {
currentPage.onUploadDouyinVideo = onUpload;
}
});
};