提交 b26dad14 编写于 作者: A Anne_LXM

调整Element为UniElement

上级 b79f7328
......@@ -21,7 +21,7 @@
export default {
data() {
return {
$elementMap: new Map<string, Element>(),
$elementMap: new Map<string, UniElement>(),
x: 0 as number,
y: 0 as number,
// 飘走的卡片计数
......@@ -88,7 +88,7 @@
} else {
// console.log('直接拿');
}
element?.style?.setProperty(propertyName, propertyStyle);
element.style.setProperty(propertyName, propertyStyle);
},
touchstart(e : TouchEvent) {
// console.log('touchstart')
......
......@@ -38,7 +38,7 @@
export default {
data() {
return {
$elementMap: new Map<string, Element>()
$elementMap: new Map<string, UniElement>()
}
},
methods: {
......@@ -64,10 +64,10 @@
},
// 工具方法,用于快速设置 Element 的 style
setElementStyle(refName : string, propertyName : string, propertyStyle : any) : void {
let element : Element | null = (this.$data['$elementMap'] as Map<string, Element>).get(refName)
let element : UniElement | null = (this.$data['$elementMap'] as Map<string, UniElement>).get(refName)
if (element == null) {
element = this.$refs[refName] as UniElement;
(this.$data['$elementMap'] as Map<string, Element>).set(refName, element)
(this.$data['$elementMap'] as Map<string, UniElement>).set(refName, element)
}
element.style.setProperty(propertyName, propertyStyle);
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册