You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
496 B
25 lines
496 B
|
2 years ago
|
<template>
|
||
|
|
<view>
|
||
|
|
<web-view :webview-styles="{height:'100%'}" ref="webview" fullscreen="false" :src="url" @message="handlePostMessage"></web-view>
|
||
|
|
</view>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<script>
|
||
|
|
export default {
|
||
|
|
data() {
|
||
|
|
return {
|
||
|
|
url: 'http://192.168.3.109:89/map.html'
|
||
|
|
}
|
||
|
|
},
|
||
|
|
onUnload() {
|
||
|
|
},
|
||
|
|
methods: {
|
||
|
|
// webview向外部发送消息
|
||
|
|
handlePostMessage: function(data) {
|
||
|
|
console.log("接收到消息:", data.detail);
|
||
|
|
uni.$emit('mapData',data.detail);
|
||
|
|
},
|
||
|
|
}
|
||
|
|
}
|
||
|
|
</script>
|