20 lines
459 B
TypeScript
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;
|
|
}
|
|
});
|
|
}; |