<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>
