From bcb5996e9056e882f195f550c559664d7b16b688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Wed, 4 Dec 2019 11:33:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8B=96=E6=8B=BD;layer?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=90=8E=E6=9C=9F=E4=BF=AE=E6=94=B9=E5=9D=90?= =?UTF-8?q?=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/drag/index.js | 5 +++++ src/layer/index.wc | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/src/drag/index.js b/src/drag/index.js index ee9ac13..fb9f816 100644 --- a/src/drag/index.js +++ b/src/drag/index.js @@ -44,6 +44,11 @@ Anot.directive('drag', { if (!target.classList) { Anot.error(`${this.name}=${this.expr}, 解析异常[元素不存在]`) } + if (target.tagName === 'WC-LAYER' && val === 'layer') { + target = target.root.children[1] + break + } + if (target.classList.contains(val) || target.id === val) { break } else { diff --git a/src/layer/index.wc b/src/layer/index.wc index abbbc91..2a82921 100644 --- a/src/layer/index.wc +++ b/src/layer/index.wc @@ -440,6 +440,14 @@ class Layer { this.setAttribute('common', '') } + moveTo(obj = {}) { + var css = '' + for (var k in obj) { + css += `${k}:${obj[k]};` + } + this.root.children[1].style.cssText += css + } + mounted() { this.type = this.props.type this.title = this.props.title @@ -578,6 +586,7 @@ class Layer { case 'title': case 'type': this[name] = val + this.removeAttribute(name) break case 'mask-color': case 'background':