diff --git a/pages/API/get-element-by-id/get-element-by-id-multiple-root-node.uvue b/pages/API/get-element-by-id/get-element-by-id-multiple-root-node.uvue index 548e928a43373e360ffc8a34dffd26f260326cb9..6041bbe1aea79f697164d2740116230ccdc898e2 100644 --- a/pages/API/get-element-by-id/get-element-by-id-multiple-root-node.uvue +++ b/pages/API/get-element-by-id/get-element-by-id-multiple-root-node.uvue @@ -28,18 +28,18 @@ }, changePageHeadBackgroundColor() { const pageHead = uni.getElementById('page-head')! - pageHead.style['backgroundColor'] = 'red' + pageHead.style.setProperty('background-color', 'red') }, changeTextColor() { const text = uni.getElementById('text')! - text.style['color'] = 'red' + text.style.setProperty('color', 'red') }, changeViewStyle() { const view = uni.getElementById('view') if (view !== null) { - view.style['width'] = '90%' - view.style['height'] = '50px' - view.style['backgroundColor'] = '#007AFF' + view.style.setProperty('width', '90%') + view.style.setProperty('height', '50px') + view.style.setProperty('backgroundColor', '#007AFF') } } } diff --git a/pages/API/get-element-by-id/get-element-by-id.uvue b/pages/API/get-element-by-id/get-element-by-id.uvue index 0a94e3fec73e846d2185dd24f59ed966d8781c73..69e7e04e05c4d748d324ee9fd3dec8e4b2e2ffde 100644 --- a/pages/API/get-element-by-id/get-element-by-id.uvue +++ b/pages/API/get-element-by-id/get-element-by-id.uvue @@ -35,18 +35,18 @@ }, changePageHeadBackgroundColor() { const pageHead = uni.getElementById('page-head')! - pageHead.style['backgroundColor'] = 'red' + pageHead.style.setProperty('background-color', 'red') }, changeTextColor() { const text = uni.getElementById('text')! - text.style['color'] = 'red' + text.style.setProperty('color', 'red') }, changeViewStyle() { const view = uni.getElementById('view') if (view !== null) { - view.style['width'] = '90%' - view.style['height'] = '50px' - view.style['backgroundColor'] = '#007AFF' + view.style.setProperty('width', '90%') + view.style.setProperty('height', '50px') + view.style.setProperty('background-color', '#007AFF') } }, goMultipleRootNode() {