Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/uni-app/src/apiLifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
ON_HIDE,
ON_INIT,
ON_LAUNCH,
ON_LIVE_MOUNT,
ON_LOAD,
ON_NAVIGATION_BAR_BUTTON_TAP,
ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED,
Expand Down Expand Up @@ -177,6 +178,9 @@ export const onCopyUrl = /*#__PURE__*/ createLifeCycleHook<
export const onUploadDouyinVideo = /*#__PURE__*/ createLifeCycleHook<
Required<Page.PageInstance>['onUploadDouyinVideo']
>(ON_UPLOAD_DOUYIN_VIDEO, HookFlags.PAGE)
export const onLiveMount = /*#__PURE__*/ createLifeCycleHook<
Required<Page.PageInstance>['onLiveMount']
>(ON_LIVE_MOUNT, HookFlags.PAGE)

export const onNavigationBarButtonTap = /*#__PURE__*/ createLifeCycleHook<
Required<Page.PageInstance>['onNavigationBarButtonTap']
Expand Down
1 change: 1 addition & 0 deletions packages/uni-cli-shared/src/vite/autoImport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const uniLifeCyclePreset = {
'onShareChat', // xhs-share
'onCopyUrl',
'onUploadDouyinVideo',
'onLiveMount',

// 辅助
'renderComponentSlot',
Expand Down
1 change: 1 addition & 0 deletions packages/uni-shared/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export const ON_INIT = 'onInit'
export const ON_SAVE_EXIT_STATE = 'onSaveExitState'
// 抖音特有
export const ON_UPLOAD_DOUYIN_VIDEO = 'onUploadDouyinVideo'
export const ON_LIVE_MOUNT = 'onLiveMount'

export const ON_RESIZE = 'onResize'
export const ON_BACK_PRESS = 'onBackPress'
Expand Down
4 changes: 4 additions & 0 deletions packages/uni-shared/src/lifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
ON_HIDE,
ON_INIT,
ON_LAUNCH,
ON_LIVE_MOUNT,
ON_LOAD,
ON_NAVIGATION_BAR_BUTTON_TAP,
ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED,
Expand Down Expand Up @@ -48,6 +49,7 @@ const PAGE_HOOKS = [
ON_SHARE_CHAT,
ON_COPY_URL,
ON_UPLOAD_DOUYIN_VIDEO,
ON_LIVE_MOUNT,
ON_ADD_TO_FAVORITES,
ON_SAVE_EXIT_STATE,
ON_NAVIGATION_BAR_BUTTON_TAP,
Expand Down Expand Up @@ -94,6 +96,7 @@ export const UniLifecycleHooks = [
ON_SHARE_CHAT,
ON_COPY_URL,
ON_UPLOAD_DOUYIN_VIDEO,
ON_LIVE_MOUNT,
ON_SAVE_EXIT_STATE,
ON_NAVIGATION_BAR_BUTTON_TAP,
ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED,
Expand All @@ -110,6 +113,7 @@ export const MINI_PROGRAM_PAGE_RUNTIME_HOOKS = /*#__PURE__*/ (() => {
onShareChat: 1 << 3,
onCopyUrl: 1 << 4,
onUploadDouyinVideo: 1 << 5,
onLiveMount: 1 << 6,
} as const
})()

Expand Down
Loading