提交 1308b04f 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

feat: getElementById 支持泛型

上级 72b582cf
......@@ -41,10 +41,12 @@ export default {
text.style.setProperty('color', 'red')
},
changeViewStyle(){
const view = uni.getElementById('view')!
view.style.setProperty('width', '90%')
view.style.setProperty('height', '50px')
view.style.setProperty('backgroundColor', '#007AFF')
const view = uni.getElementById<UniViewElement>('view')
if(view !== null){
view.style.setProperty('width', '90%')
view.style.setProperty('height', '50px')
view.style.setProperty('backgroundColor', '#007AFF')
}
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册