美文网首页
vue- v-for

vue- v-for

作者: AssertDo | 来源:发表于2019-09-29 13:58 被阅读0次
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <script src="./lib/vue-2.4.0.js"></script>
</head>

<body>
  <div id="app">
    <p v-for="(item, i) in list">索引值:{{i}} --- 每一项:{{item}}</p>

  </div>

  <script>
    // 创建 Vue 实例,得到 ViewModel
    var vm = new Vue({
      el: '#app',
      data: {
        list: [1, 2, 3, 4, 5, 6]
      },
      methods: {}
    });
  </script>
</body>

</html>

相关文章

网友评论

      本文标题:vue- v-for

      本文链接:https://www.haomeiwen.com/subject/yhynectx.html