(component): 修复 layer 在 google 高版本中的警告提示

This commit is contained in:
就眠儀式 2022-10-10 23:38:54 +08:00
parent 2f52cc2739
commit b94fbce367
2 changed files with 2 additions and 2 deletions

View File

@ -4,7 +4,7 @@ const useMove = function (el: HTMLElement, callback: Function) {
let offsetY: number;
if (el != null) {
el.addEventListener("mousedown", function (event: any) {
const path = event.composedPath();
const path = (event.composedPath && event.composedPath()) || event.path;
if (path[0].className === "layui-layer-title") {
if (event.button == 0 && el != null) {
const lexObj: any = getComputedStyle(el);

View File

@ -1,7 +1,7 @@
const useMove = function (el: HTMLElement, callback: Function) {
if (el != null) {
el.addEventListener("mousedown", function (event: any) {
const path = event.composedPath();
const path = (event.composedPath && event.composedPath()) || event.path;
if (path[0].className === "layui-layer-resize") {
if (event.button == 0 && el != null) {
var x = el.offsetLeft;