提交 3c4ac57d 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

feat: getElementById 支持泛型

上级 8e6663ea
...@@ -41,10 +41,12 @@ export default { ...@@ -41,10 +41,12 @@ export default {
text.style.setProperty('color', 'red') text.style.setProperty('color', 'red')
}, },
changeViewStyle(){ changeViewStyle(){
const view = uni.getElementById('view')! const view = uni.getElementById<UniViewElement>('view')
view.style.setProperty('width', '90%') if(view !== null){
view.style.setProperty('height', '50px') view.style.setProperty('width', '90%')
view.style.setProperty('backgroundColor', '#007AFF') 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.
先完成此消息的编辑!
想要评论请 注册