Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mall-webview
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
frontend
mall-webview
Commits
ab937710
Commit
ab937710
authored
Mar 26, 2021
by
hewenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: wordspell
parent
fa44f64f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
use-native-bridge.ts
src/util/use-native-bridge.ts
+2
-2
index.vue
src/views/test/index.vue
+2
-2
No files found.
src/util/use-native-brid
a
ge.ts
→
src/util/use-native-bridge.ts
View file @
ab937710
...
@@ -37,7 +37,7 @@ const sendNativeMessage = (data: { type: string; data: any }) => {
...
@@ -37,7 +37,7 @@ const sendNativeMessage = (data: { type: string; data: any }) => {
window
.
ReactNativeWebView
.
postMessage
(
JSON
.
stringify
(
data
));
window
.
ReactNativeWebView
.
postMessage
(
JSON
.
stringify
(
data
));
};
};
function
useNativeBrid
a
ge
(
function
useNativeBridge
(
eventType
:
string
,
eventType
:
string
,
listener
:
(
this
:
ComponentInternalInstance
|
null
,
...
arg
:
any
[])
=>
any
listener
:
(
this
:
ComponentInternalInstance
|
null
,
...
arg
:
any
[])
=>
any
):
[
typeof
sendNativeMessage
,
typeof
eventBus
]
{
):
[
typeof
sendNativeMessage
,
typeof
eventBus
]
{
...
@@ -66,4 +66,4 @@ function useNativeBridage(
...
@@ -66,4 +66,4 @@ function useNativeBridage(
return
[
sendNativeMessage
,
eventBus
];
return
[
sendNativeMessage
,
eventBus
];
}
}
export
{
useNativeBrid
a
ge
};
export
{
useNativeBridge
};
src/views/test/index.vue
View file @
ab937710
...
@@ -5,9 +5,9 @@
...
@@ -5,9 +5,9 @@
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
ref
}
from
"vue"
;
import
{
ref
}
from
"vue"
;
import
{
useNativeBrid
age
}
from
"@/util/use-native-brida
ge"
;
import
{
useNativeBrid
ge
}
from
"@/util/use-native-brid
ge"
;
const
[
sendNativeMessage
,
eventBus
]
=
useNativeBrid
a
ge
(
"bindWechatChange"
,
function
(
arg
)
{
const
[
sendNativeMessage
,
eventBus
]
=
useNativeBridge
(
"bindWechatChange"
,
function
(
arg
)
{
console
.
log
(
this
,
arg
);
console
.
log
(
this
,
arg
);
});
});
const
count
=
ref
(
1000
);
const
count
=
ref
(
1000
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment