chore(components): diy组件部分添加点击事件句柄重新处理
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
:longitude="item.lng"
|
||||
:latitude="item.lat"
|
||||
show-location>
|
||||
<cover-view style="position:absolute;right:10px;bottom:30rpx;z-index:99999;background:#4390FF;padding:5px 10px;wxcs_style_padding:10rpx 20rpx;border-radius:8rpx;color: #fff;" @click="tomap(item)">
|
||||
<cover-view style="position:absolute;right:10px;bottom:30rpx;z-index:99999;background:#4390FF;padding:5px 10px;wxcs_style_padding:10rpx 20rpx;border-radius:8rpx;color: #fff;" @click="handlerClick(item)" @tap="handlerClick(item)">
|
||||
<cover-view style="font-size:24rpx">一键导航</cover-view>
|
||||
</cover-view>
|
||||
</map>
|
||||
@@ -20,6 +20,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// 地图
|
||||
import DiyMinx from './minx.js'
|
||||
export default {
|
||||
name: 'diy-map',
|
||||
props: {
|
||||
@@ -35,6 +37,7 @@
|
||||
},
|
||||
created() {
|
||||
},
|
||||
mixins: [DiyMinx],
|
||||
watch: {
|
||||
// 组件刷新监听
|
||||
componentRefresh: function(nval) {
|
||||
@@ -68,6 +71,12 @@
|
||||
longitude: parseFloat(item.lng),
|
||||
name:"一键导航",
|
||||
})
|
||||
},
|
||||
async handlerClick(item) {
|
||||
await this.__$emitEvent({eventName: 'map-tap', data: item, promiseCallback: (event, handler, awaitedResult) => {
|
||||
if (!awaitedResult) return;
|
||||
this.tomap(item);
|
||||
}})
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user