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':