提交 eb27ca5c 编写于 作者: 雪洛's avatar 雪洛

fix: 调整示例兼容类型定义

上级 ae92c8a1
...@@ -28,18 +28,18 @@ ...@@ -28,18 +28,18 @@
}, },
changePageHeadBackgroundColor() { changePageHeadBackgroundColor() {
const pageHead = uni.getElementById('page-head')! const pageHead = uni.getElementById('page-head')!
pageHead.style['backgroundColor'] = 'red' pageHead.style.setProperty('background-color', 'red')
}, },
changeTextColor() { changeTextColor() {
const text = uni.getElementById('text')! const text = uni.getElementById('text')!
text.style['color'] = 'red' text.style.setProperty('color', 'red')
}, },
changeViewStyle() { changeViewStyle() {
const view = uni.getElementById<UniViewElement>('view') const view = uni.getElementById<UniViewElement>('view')
if (view !== null) { if (view !== null) {
view.style['width'] = '90%' view.style.setProperty('width', '90%')
view.style['height'] = '50px' view.style.setProperty('height', '50px')
view.style['backgroundColor'] = '#007AFF' view.style.setProperty('backgroundColor', '#007AFF')
} }
} }
} }
......
...@@ -35,18 +35,18 @@ ...@@ -35,18 +35,18 @@
}, },
changePageHeadBackgroundColor() { changePageHeadBackgroundColor() {
const pageHead = uni.getElementById('page-head')! const pageHead = uni.getElementById('page-head')!
pageHead.style['backgroundColor'] = 'red' pageHead.style.setProperty('background-color', 'red')
}, },
changeTextColor() { changeTextColor() {
const text = uni.getElementById('text')! const text = uni.getElementById('text')!
text.style['color'] = 'red' text.style.setProperty('color', 'red')
}, },
changeViewStyle() { changeViewStyle() {
const view = uni.getElementById<UniViewElement>('view') const view = uni.getElementById<UniViewElement>('view')
if (view !== null) { if (view !== null) {
view.style['width'] = '90%' view.style.setProperty('width', '90%')
view.style['height'] = '50px' view.style.setProperty('height', '50px')
view.style['backgroundColor'] = '#007AFF' view.style.setProperty('background-color', '#007AFF')
} }
}, },
goMultipleRootNode() { goMultipleRootNode() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册