vue for 循环例子 2

demo

 

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Vue 测试实例</title>
  <script src="https://cdn.bootcss.com/vue/2.2.2/vue.min.js"></script>
</head>
<body>
   <div id="three">
     <ul>
       <ol v-for="(value,key,index) in object">
           {{index}}:{{key}}:{{value}}
       </ol>
       <ol v-for="value in object1">
           {{value}}
       </ol>
     </ul>
   </div>
<script>
    new Vue({
      el:'#three',
        data:{
          object:{
            name:   "博客园",
            url:    "http:baidu.com",
            slogan:  "努力总会回报"
          },

          object1:{
            name:   "百度",
            url:    "http:baidu.com",
            slogan:  "百度一下,你就知道"
          }

        }

    })
</script>
</body>
</html>

 效果:

 

23:02:51   2018-03-19

posted @ 2018-03-19 23:03  1点  阅读(116)  评论(0编辑  收藏  举报