current position:Home>[taro] taro gets the detailed attributes of the element (solved)

[taro] taro gets the detailed attributes of the element (solved)

2022-05-15 05:04:56Silent tubule

Ed Write No easy , also Greek at various position Big Guy the a One Next \textcolor{gray}{ It's not easy to write , I also hope you guys can support } Ed Write No easy , also Greek at various position Big Guy the a One Next

individual people Lord page : \textcolor{green}{ Personal home page :} individual people Lord page Silent tubule

individual people network standing : \textcolor{green}{ Personal website :} individual people network standing Silent tubule

Technology Technique hand over flow Q Q Group : 837051545 \textcolor{green}{ Technical communication QQ Group :837051545} Technology Technique hand over flow QQ Group 837051545

spot Fabulous , you Of recognize can yes I gen do Of dynamic force ! \textcolor{green}{ give the thumbs-up , Your recognition is the driving force of my creation !} spot Fabulous , you Of recognize can yes I gen do Of dynamic force

closed hidden , you Of green look at yes I No force Of Fang towards ! \textcolor{green}{ Collection , Your favor is the direction of my efforts !} closed hidden , you Of green look at yes I No force Of Fang towards

review On , you Of It means see yes I Into the Step Of goods rich ! \textcolor{green}{ Comment on , Your opinion is the wealth of my progress !} review On , you Of It means see yes I Into the Step Of goods rich

If you don't understand, you can leave a message , I should see a reply
If there is a mistake , Your advice are most welcome

Problem description

Use taro Get the wide and high attributes of the element , Post it according to the example on the official website , however Still can't get , I was confused at that time ~~~~~
Official website code link

My code

Get the element after the component is mounted
 Insert picture description here
 Insert picture description here
The result is : He didn't come out, the result ~mmp

Solution flow

1. stay render Write in
 Insert picture description here
2. stay componentDidMount Add timer in the life cycle , Delay getting element attributes
 Insert picture description here
result :
 Insert picture description here

copyright notice
author[Silent tubule],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/135/202205142220144884.html

Random recommended