You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by GitBox <gi...@apache.org> on 2019/05/05 08:14:17 UTC

[GitHub] [incubator-weex] zsmjhtn opened a new issue #2391: [Android]Unexpected behavior when I control v-if where weex version is 0.18

zsmjhtn opened a new issue #2391: [Android]Unexpected behavior when I control v-if where weex version is 0.18
URL: https://github.com/apache/incubator-weex/issues/2391
 
 
   <!--
   Thanks for using Weex. Github Issue is only used for bur report and please follow the template to report the bug. 
   A good bug report should include the following information:
   -->
   
   <!-- Requirements: please go through this checklist before opening a new issue
     - * Review the documentation: https://weex.apache.org/index.html
     - * Search for existing issues: https://github.com/apache/incubator-weex/issues
     - * Use the latest Weex release: https://github.com/apache/incubator-weex/releases -->
   
   
   ## Describe the bug
   <!-- A clear and concise description of what the bug is. -->
   just look the code:
   <img width="496" alt="image" src="https://user-images.githubusercontent.com/18029210/57190488-3f7f8f00-6f4d-11e9-9e9b-9dc17845c9ee.png">
   <img width="672" alt="image" src="https://user-images.githubusercontent.com/18029210/57190500-663dc580-6f4d-11e9-8752-f9d30c4bcd17.png">
   <img width="446" alt="image" src="https://user-images.githubusercontent.com/18029210/57190504-6d64d380-6f4d-11e9-925b-18e977436f97.png">
   
   when the **data** back from network, **both params**  are changing from **Visiable** to **Gone**,which named **is201904** && **isSubscribeWX** for controlling UI。
   In my opinion, only the **image** && **the second div** will disappear,and weex always work like this。
   To my surprise,
   `<text style="font-size:24px;color:#999;" >{{currentMonth}}月已收收益(元)</text>`
   this text will disappear, too !!!
   I know both use v-if && v-else will **reuse** the layout without a **key** in **Vue**.But I remind  Vue will not reuse layout  when I only use **v-if**。
   I have found two ways to solve / avoid this problem:
   1. Set a key for the disappear text.Tell Vue not reuse this text.And text will not be gone . But I don not know why **Weex/Vue** thought this text should be reuse !?? 
   2. Not change both params at the time.Set one param at the front of another. For example, 
   `setTimeout(()=> this.is201904 = ..., 3000)
    setTimeout(()=> this.isSubscribeWX = ...., 3000)
   `
   ## To Reproduce
   <!-- Steps to reproduce the behavior.  Include a MCVE using http://dotwe.org/vue , crash stacktrace or  share your app project. Please follow the guidelines for providing a MCVE: https://stackoverflow.com/help/mcve -->
   
   ## Environment
   <!-- 
   * Device: [e.g. iPhone6]
   * OS: [e.g. iOS8.1]
   * Version [e.g. 22]
   * Build from source [e.g. yes/no] -->
   weex 0.18  
   all android device behaviour it
   ios is ok!👌
   ## Expected behavior
   <!-- A clear and concise description of what you expected to happen. -->
   The text which without v-if control will not disappear 。I don not think it is a right behaviour in Android !
   ## Screenshots
   <!-- If applicable, add screenshots to help explain your problem. -->
   
   ## Additional context
   <!-- Add any other context about the problem here.-->

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


With regards,
Apache Git Services