Vue template syntax - data responsive

A data responsive

  1. How to understand Responsive
    • in response to html5 formula: screen size change results in a change pattern
    • Responsive Data: changes in the data lead to changes in the page content
  2. What is Data Binding

    Binding: filling data into the label

  3. v-once compiled only once

    After the display contents are no longer responsive function

Two, v-once instruction

  1. v-once scenarios

    If the subsequent information without further modification, use v-once, this can improve performance.

  2. v-once usage

    Add v-once instruction required filling Tags

  3. E.g
      <div id='app'>
        <div>{{msg}}</div>
        <div v-once>{{info}}</div>
      </div>
      <script type="text/javascript" src="js/vue.js"></script>
      <script type="text/javascript">
         var vm =new Vue({
               el:'#app',
               data:{
                  msg:'HelloWorld',
                  info:'Vue是真得好!!!'
               }
         })
      </script>

Results:
In the browser console, by vm.msg=***changing the value of the msg, can not be used vm.info=***to change the value of info

Guess you like

Origin www.cnblogs.com/fpgz99810/p/12465819.html