需求为h5页面 内嵌进app
当点击图片热区时 向app传递参数 由app进行拦截处理
h5-app交互采用 app拦截URL Schemes的方式
以下为代码
<template>
<div class="home">
<div class="re-div">
<img :src="imgUrl" usemap="#planetmap" class="ab-img">
<map name="planetmap" id="planetmap">
<area v-for="item,index in divArr" :key="index" shape="rect" :coords="item.coords" href="#" @click="jump(item)" />
</map>
<div v-for="item,index in divArr" :key="index" :style="{ top:item.top,left: item.left,width:item.width,height:item.height}" class="boeder-div">{
{
item.name}}</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
imgUrl: "",
screenWidth: document.body.clientWidth, //监听窗口大小变化
areaList: [],
divArr: [],