forked from dcloudio/uni-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(mp-alipay): handleProps before handleRef
- Loading branch information
1 parent
adcb22e
commit 8c30bd3
Showing
2 changed files
with
37 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { handleProps } from './wrapper/util' | ||
|
||
const MPComponent = Component | ||
|
||
function initHook (name, options) { | ||
const oldHook = options[name] | ||
options[name] = function (...args) { | ||
const props = this.props | ||
if (props && props['data-com-type'] === 'wx') { | ||
handleProps(this) | ||
} | ||
if (oldHook) { | ||
return oldHook.apply(this, args) | ||
} | ||
} | ||
} | ||
|
||
if (!MPComponent.__$wrappered) { | ||
MPComponent.__$wrappered = true | ||
Component = function (options = {}) { | ||
initHook('onInit', options) | ||
return MPComponent(options) | ||
} | ||
} |
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