Faster application refresh understand

refresh stepped pit

 

refresh assembly disposed background-color / progress-color error problem 

There are a lot of people would think two attributes refresh that does not work. This is misunderstood. This property is not set two components. And represents the background color of the load button, shown in FIG.

 

 

 

 

 

The sample code below - Transfer official demo

 

<Template> 
  <-! Template in only a root node -> 
  <div class = "Demo-Page"> 
     <Refresh class = "Refresh" OnRefresh = "Refresh" Refreshing = "{} {} isRefreshing" type = "{{the refreshType}}"> 
      <div class = "Page-title-wrap"> 
          <text class = "Page-title"> {{componentName}} </ text> 
      </ div> 
      <div class = "Item -container "> 
        <INPUT class =" BTN "type =" Button "value =" stop refreshing "the onclick =" stopRefresh "/> 
        <INPUT class =" BTN "type =" Button "value =" {{=== the refreshType 'Auto' 'turn on the pull-down spring back effect':? 'rebound off the pull-down effect'}} "onclick ="changeType"/>
      </div>
    </refresh>
  </div>
</template>

<script>
 import prompt from '@system.prompt'

  export default { 
    Private: { 
      componentName: 'Refresh' , 
      isRefreshing: to false , 
      the refreshType: 'Auto' 
    }, 
    the onInit () { 
      the this . $ page.setTitleBar ({text: 'the Refresh' }) 
    }, 
    changeType () { 
      the this .refreshType = the this ? .refreshType === 'Auto' 'pulldown': 'Auto' 
    }, 
    refresh (E) { 
      const Self = the this 
      // update refresh state (refreshing property value from false to true refresh trigger assembly update, and vice versa) 
      self.isRefreshing = e.refreshing 
      the setTimeout (function () {
         // Close refresh state 
        self.isRefreshing = to false 
        prompt.showToast ({ 
          Message: 'refresh is complete' 
        }) 
      }, 3000 ) 
    }, 
    stopRefresh () { 
      the this .isRefreshing = to false 
    }, 
  }
 </ Script> 

< style> 
  .demo - Page { 
    Flex - direction: column; 
    The justify - Content: Center; 
    align = left - items: Center; 
  } 
    .Refresh { 
    Flex -direction: column;
    flex: 1;
    progress-color: #ff0000;
    background-color:#fff000;
  }

  .item-container{
    margin-bottom: 50px;
    margin-right: 60px;
    margin-left: 60px;
    flex-direction: column;
  }

  .title {
    font-size: 40px;
    text-align: center;
  }

  .btn {
    width: 550px;
    height: 86px;
    margin-top: 75px;
    border-radius: 43px;
    background-color: #09ba07;
    font-size: 30px;
    color: #ffffff;
  }
</style>

 

Guess you like

Origin www.cnblogs.com/maomao-Sunshine/p/11769624.html