vue如何渲染一维数组

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<title>Vue 测试实例 - 菜鸟教程(runoob.com)</title>

<script src="https://cdn.bootcss.com/vue/2.2.2/vue.min.js"></script>

</head>

<body>

<div id="app">

  <ol>

    <li v-for="site in sites">

      {{ site.name }}

    </li>

  </ol>

</div>


<script>

new Vue({

  el: '#app',

  data: {

    sites:["教育", "文艺", "青春", "生活", "人文社科", "经管", "科技", "电子书"];

  }

})

</script>

</body>

</html>


LEATH
浏览 482回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript