UNPKG
magic-helper
Version:
latest (1.0.0)
1.0.0
this is magic helper
magic-helper
/
lib
/
h5
/
action.js
16 lines
(15 loc)
•
366 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import
h5
from
'weixin-js-sdk'
;
export
const
action
= (
action
) => {
return
new
Promise
(
(
resolve, reject
) =>
{
try
{ h5.
miniProgram
.
postMessage
({
data
: action }); h5.
miniProgram
.
navigateBack
();
resolve
(
'ok'
); }
catch
(error) {
reject
(error); } }); };