zsmjhtn commented on 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#issuecomment-494251601
 
 
   ```javascript
   <template>
     <div class="main">
       <scroller class="main-scroll">
         <div class="div-card">
           <image v-if="isSubscribeWX == '0'" class="img-wx" 
:src="'img/bill_wx.png'"> </image>
           <div class="div-card-header">
             <text style="font-size:24px;color:#999;" 
>{{currentMonth}}月已收收益(元)</text>
             <image style="width:24;height:24;margin-left:8" 
src="img/icon_tips.png"></image>
           </div>
           <div v-if="is201904 == '0'"  class="div-card-bottom">
             <text :style="{'font-size':24,color:'#333'}">比上月</text>
           </div>
         </div>
       </scroller>
     </div>
   </template>
   <style>
   .main {
     width: 750;
     justify-content: flex-start;
     align-items: center;
     background-color: #ffffff;
   }
   .main-scroll {
     flex: 1;
     width: 750;
     justify-content: flex-start;
     align-items: center;
      padding-bottom: 40;
   }
   .img-wx{
     position: absolute;
     right: 0;
     top: 28;
     width: 150;
     height: 44;
   }
   .img-bg {
     position: absolute;
     left: 0;
     top: 0;
     bottom:0;
     right:0;
     width: 750;
     height: 1402;
   }
   .div-center {
     margin-top: 24;
     flex-direction: column;
     justify-content: flex-start;
     align-items: center;
     background-color: #ffffff;
     box-shadow:0 6px 20px 0 rgba(0,0,0,0.06);
     border-radius:16px;
   }
   
   .div-card {
     margin-top: 24px;
     background-color: #ffffff;
     box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.06);
     border-radius: 16px;
     width: 700px;
     flex-direction: column;
     justify-content: flex-start;
     align-items: center;
   }
   .div-card-header {
     margin-top: 32px;
     flex-direction: row;
     justify-content: center;
     align-items: center;
   }
   .div-card-bottom {
     margin-top: 16px;
     margin-bottom: 40px;
     flex-direction: row;
     justify-content: center;
     align-items: center;
   }
   
   .div-profit {
     margin-top: 40px;
     margin-bottom: 54px;
     flex-direction: column;
     justify-content: center;
     align-items: center;
   }
   </style>
   <script>
   const _ = require("./../async/_Vue.js");
   const ENHANCE = require("../enhance-vue");
   export default {
     props:{
       dto:{
         type:Object,
         default:{},
       },
       currentMonth:{
         type: Number,
         default: undefined,
       }
     },
     watch: {
       dto: {
         handler: function(x) {
           this.buildViewModule(x)
         },
         immediate: true
       },
     },
     data: () => ({
       totalProfit: 0,//总收益
       is201904:0,//'1'是,‘0’不是
       isSubscribeWX:0,//'1'是,‘0’不是
     }),
     created() {
       ENHANCE.enhance(this);
      
     },
     methods: {
       buildViewModule(dto){
         this.totalProfit = dto.totalProfit
         setTimeout(()=>{
              this.isSubscribeWX = dto.isSubscribeWX || '0';
              this.is201904 = dto.is201904 || '0';
         }, 3000)
       }
     }
   };
   </script>
   ```

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to