使用vue.js、mapbox实现leaflet全屏渲染实现,使用element实现功能,出现部分控件弹框不显示解决方法
程序员文章站
2022-03-21 19:25:38
fullscreen实现://单击事件toggleFullScreen(isFullscreen) { const vm = this; vm.isFullscreen = isFullscreen; if (vm.map) { vm.map.toggleFullscreen({ pseudoFullscreen: true }); } },//默认加载initLeafletFull....
fullscreen实现:
//单击事件
toggleFullScreen(isFullscreen) {
const vm = this;
vm.isFullscreen = isFullscreen;
if (vm.map) {
vm.map.toggleFullscreen({
pseudoFullscreen: true
});
}
},
//默认加载
initLeafletFullScreenPlugin() {
const vm = this;
if (vm.map) {
vm.map.on("fullscreenchange", () => {
vm.isFullscreen = vm.map.isFullscreen();
if (vm.isFullscreen) {
vm.$message.info("按 【ESC键】 可退出全屏模式");
$("body").addClass("fullscreen");
} else {
$("body").removeClass("fullscreen");
}
});
}
/** ESC 退出全屏 */
const docKeyDownHandler = e => {
const { keyCode } = e;
if (keyCode == 27 && vm.isFullscreen) {
vm.toggleFullScreen();
}
};
document.addEventListener("keydown", docKeyDownHandler, false);
vm.$options["beforeDestroy"].push(() => {
document.removeEventListener("keydown", docKeyDownHandler);
});
},
element控件中部分小窗口遮挡处理方法:
el-dialog :modal-append-to-body="false"
el-select :popper-append-to-body="false"
el-date-picker :append-to-body="false"
参考:
https://blog.csdn.net/ProgramarQin/article/details/102727690
https://github.com/ElemeFE/element/issues/12872
本文地址:https://blog.csdn.net/u014182690/article/details/107387386
下一篇: 如何获取腾讯视频的缩略图地址?