Skip to content

Commit cde9515

Browse files
committed
update: call platform api with mpvue,such as mpvue.getUserInfo
1 parent b548dd9 commit cde9515

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/platforms/mp/join-code-in-build.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ try {
99
global.Page = global.Page || Page;
1010
global.Component = global.Component || Component;
1111
global.getApp = global.getApp || getApp;
12+
13+
if (typeof wx !== 'undefined') {
14+
global.mpvue = wx;
15+
global.mpvuePlatform = 'wx';
16+
} else if (typeof swan !== 'undefined') {
17+
global.mpvue = swan;
18+
global.mpvuePlatform = 'swan';
19+
}
1220
} catch (e) {}
1321
`
1422

0 commit comments

Comments
 (0)