Skip to content

Commit

Permalink
Merge pull request #15437 from heweishui/hybrid
Browse files Browse the repository at this point in the history
fix: 在hybrid插件中增加对hooks的支持
  • Loading branch information
qican777 authored Apr 10, 2024
2 parents 0365ac8 + 3c1ccac commit f5faab6
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/mini-program-example/project.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@
"tabIndent": "insertSpaces",
"tabSize": 2
}
}
}
2 changes: 1 addition & 1 deletion examples/mini-program-example/project.private.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"setting": {
"compileHotReLoad": true
}
}
}
1 change: 1 addition & 0 deletions packages/taro-platform-harmony-hybrid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"@tarojs/runtime": "workspace:*",
"@tarojs/shared": "workspace:*",
"@tarojs/taro-h5": "workspace:*",
"@tarojs/plugin-platform-h5": "workspace:*",
"babel-plugin-transform-taroapi": "workspace:*",
"resolve": "^1.22.0",
"lodash-es": "4.17.21",
Expand Down
71 changes: 70 additions & 1 deletion packages/taro-platform-harmony-hybrid/src/api/apis/taro.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Taro from '@tarojs/api'
import Taro from '@tarojs/plugin-platform-h5/dist/runtime/apis'
import { history } from '@tarojs/router'
import { isFunction, PLATFORM_TYPE } from '@tarojs/shared'
import { toByteArray } from 'base64-js'
Expand Down Expand Up @@ -33,6 +33,29 @@ const {
eventCenter,
Events,
preload,
useAddToFavorites,
useDidHide,
useDidShow,
useError,
useLaunch,
useLoad,
useOptionMenuClick,
usePageNotFound,
usePageScroll,
usePullDownRefresh,
usePullIntercept,
useReachBottom,
useReady,
useResize,
useRouter,
useSaveExitState,
useShareAppMessage,
useShareTimeline,
useTabItemTap,
useTitleClick,
useScope,
useUnhandledRejection,
useUnload
} = Taro as any

const taro: typeof Taro = {
Expand All @@ -57,6 +80,29 @@ const taro: typeof Taro = {
redirectTo,
getCurrentPages,
switchTab,
useAddToFavorites,
useDidHide,
useDidShow,
useError,
useLaunch,
useLoad,
useOptionMenuClick,
usePageNotFound,
usePageScroll,
usePullDownRefresh,
usePullIntercept,
useReachBottom,
useReady,
useResize,
useRouter,
useSaveExitState,
useShareAppMessage,
useShareTimeline,
useTabItemTap,
useTitleClick,
useScope,
useUnhandledRejection,
useUnload
}

export const requirePlugin = permanentlyNotSupport('requirePlugin')
Expand Down Expand Up @@ -331,4 +377,27 @@ export {
options,
preload,
pxTransform,
useAddToFavorites,
useDidHide,
useDidShow,
useError,
useLaunch,
useLoad,
useOptionMenuClick,
usePageNotFound,
usePageScroll,
usePullDownRefresh,
usePullIntercept,
useReachBottom,
useReady,
useResize,
useRouter,
useSaveExitState,
useScope,
useShareAppMessage,
useShareTimeline,
useTabItemTap,
useTitleClick,
useUnhandledRejection,
useUnload
}
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f5faab6

Please sign in to comment.