在组件中,我想将对象翻译(拖动)到其他位置,并且我有此拖动方法用于翻译对象或说div,但出现标题中提到的错误。
onDragStart(element: HTMLElement) {
var style = window.getComputedStyle(element);
var matrix = new WebKitCSSMatrix(style.webkitTransform);
this.translateY = matrix.m42 + 80;
this.translation = "translate( 0px," + this.translateY + "px)";
console.log(element);
}
<div [ngStyle]="translation">
</div>
我只能通过更改解决此问题
[ngStyle]="translation"
至
[style.transform]="translation"
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句