Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.0.3/vue.js"></script><body>
<body>
  <div id="root">
    <div v-if="show">hello world</div>
    <button @click="handleClick">toggle</button>
    <ul>
      <!-- 在li标签中 添加v-for指令 -->
      <li v-for="item of list">{{item}}</li>
    </ul>
  </div>
  <script>
    new Vue({
      el: "#root", 
      data: {
        show: true,
        list: [1,2,3]   //添加list数组
      },
      methods: {
        handleClick: function(){
          this.show = !this.show
        }
      }
    })
  </script>
</body>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
evenyaopro
0viewers