获取当前最大z-index

[...document.all].reduce((r, e) => Math.max(r, +window.getComputedStyle(e).zIndex || 0), 0)

在element-ui中,可以统一使用PopupManager管理

import { PopupManager } from 'element-ui/lib/utils/popup'

PopupManager.nextZIndex()

作者:麦芽蕊
链接:https://www.jianshu.com/p/930cbaa067a3
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

原文地址:https://www.cnblogs.com/zhizhi0810/p/11721562.html