🐛(component): 修复 layer 在 google 高版本中的警告信息

This commit is contained in:
就眠儀式
2022-10-10 23:35:01 +08:00
parent 98ca6a61b5
commit 2f52cc2739
4 changed files with 16 additions and 14 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.path || (event.composedPath && event.composedPath());
const path = event.composedPath();
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.path || (event.composedPath && event.composedPath());
const path = event.composedPath();
if (path[0].className === "layui-layer-resize") {
if (event.button == 0 && el != null) {
var x = el.offsetLeft;