Vue for循环 例子

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) in object">
            {{key}}:{{value}}
       </ol>
     </ul>
   </div>
<script>
    new Vue({
      el:'#three',
        data:{
          object:{
            name:   "博客园",
            url:    "http:baidu.com",
            slogan:  "努力总会回报"
          }
        }
    })
</script>
</body>
</html>

  效果:

 

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