提交 9f5386f8 编写于 作者: DCloud-yyl's avatar DCloud-yyl

调整$refs获取Element写法

上级 a8214080
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<view slot="refresher"> <view slot="refresher">
<view class="head-img-box-1"> <view class="head-img-box-1">
<image class="img" ref="head-img-1" src="../../../static/template/pull-zoom-image/head-img.jpg" mode="scaleToFill"></image> <image class="img" ref="head-img-1" src="/static/template/pull-zoom-image/head-img.jpg" mode="scaleToFill"></image>
</view> </view>
</view> </view>
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
setElementStyle(refName : string, propertyName : string, propertyStyle : any) : void { setElementStyle(refName : string, propertyName : string, propertyStyle : any) : void {
let element : Element | null = this.$elementMap.get(refName) let element : Element | null = this.$elementMap.get(refName)
if (element == null) { if (element == null) {
element = this.$refs[refName] as Element; element = this.$refs.get(refName) as Element;
this.$elementMap.set(refName, element) this.$elementMap.set(refName, element)
} }
element.style.setProperty(propertyName, propertyStyle); element.style.setProperty(propertyName, propertyStyle);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册