This repository has been archived on 2023-08-30. You can view files and clone it, but cannot push or open issues/pull-requests.
bytedo
/
wcui
Archived
1
0
Fork 0

优化拖拽;layer支持后期修改坐标

old
宇天 2019-12-04 11:33:21 +08:00
parent 4a5222fcf8
commit bcb5996e90
2 changed files with 14 additions and 0 deletions

View File

@ -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 {

View File

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