AntiMoron opened a new issue #2055: getComponentRect什么时候出个同步版本
URL: https://github.com/apache/incubator-weex/issues/2055
 
 
   现在的方式都是
   ```javascript
   const dom = weex.requireModule('dom');
   dom.getComponentRect(ref, ({size}) => {
     blabla
   });
   ```
   
实际这个和前端DOM的设计没对齐.在做三端兼容的代码时候体验就不是很好,尤其是多个DOM宽度计算相互依赖的情况下,又要判断DOM有没有又要异步看看结果异步拿到没。正常前端是:
   ```javascript
   [sw, sh] = [dom.scrollWidth, dom.scrollHeight];
   ```
   期待能在结果返回上在同一个call/cc里,如下这样最好:
   ```javascript
   const dom = weex.requireModule('dom');
   const domInfo = dom.getComponentRectSync(ref);
   // domInfo.size.blabla...
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to