<template>
    <iframe id="iframe" frameborder="0" scrolling="no" :src="src"> </iframe>
</template>
<script>
window.addEventListener(
    'message',
    function(event) {
        if (event.origin === 'https://3gimg.qq.com') {
            var loc = event.data;
            console.log(loc);
            if (window.ReactNativeWebView) {
                window.ReactNativeWebView.postMessage(JSON.stringify(loc));
            }
        }
    },
    false,
);
export default {
    name: '',
    data() {
        return {
            location: '',
        };
    },
    computed: {
        src() {
            return '  https://apis.map.qq.com/tools/routeplan/eword=故宫博物馆&epointx=116.39710&epointy=39.917200?key=GLFBZ-ZR2W6-76XSA-MF7CQ-GDJ6Z-6FB5K&referer=Dingdong';
        },
    },
    created() {
        // if (this.$route.query.location) {
        //     this.location = this.$route.query.location;
        // }
    },
};
</script>
<style lang="less" scoped>
#iframe {
    width: 100vw;
    height: 100vh;
}
</style>
