Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #692 from didi/feat-add-h5-load-options
输出h5 onLoad 钩子执行补充options参数
- Loading branch information
Showing
4 changed files
with
32 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* 输出 H5 页面 onLoad | ||
* @param mixinType | ||
* @returns {{created(): void}} | ||
*/ | ||
import { CREATED } from '../../core/innerLifecycle' | ||
export default function onLoad (mixinType) { | ||
if (mixinType === 'page' && __mpx_mode__ === 'web') { | ||
return { | ||
[CREATED] () { | ||
if (this.onLoad) { | ||
const current = (global.__mpxRouter && global.__mpxRouter.currentRoute) || {} | ||
this.onLoad(current.query) | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters