Skip to content

Commit

Permalink
fix: 修复uniapp的h5平台下钩子里偶尔拿不到参数的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
qi.zhang17 committed Nov 5, 2022
1 parent 2864407 commit 236b8b9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@semantic-release/git",
{
"assets": [
"lib/spa-custom-hooks.js",
"package.json",
"CHANGELOG.md"
],
Expand Down
2 changes: 1 addition & 1 deletion lib/spa-custom-hooks/custom-hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class customHook {
// 所有钩子对象,注册的所有钩子的hookEntity类集合
this.hook = {};
// url里的参数
this.options = options;
this.options = options || {};
// 钩子对象
this.pageHooks = pageHooks;
// page的hooks对象
Expand Down
2 changes: 1 addition & 1 deletion lib/spa-custom-hooks/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const install = (vue,params,store,storeKey)=>{
if(typeof this.customHook != 'object' && typeof this.customHook != null) return
//customHook里没有自定义钩子不作处理
if(!this.customHook.customHookArr.length) return
if(options){
if(options && Object.keys(options).length > 0){
this.customHook.options = options
}
const hooks = this.customHook.hook
Expand Down

1 comment on commit 236b8b9

@1977474741
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#24

Please sign in to comment.