Vue 简单案例 2

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Vue 测试实例</title>
<script src="https://unpkg.com/vue/dist/vue.min.js"></script>
</head>
<body>
<div id="app">
  <ul>
    <li v-for="book in books">{{ book.name }}</li>
  </ul>
</div>

<script>
new Vue({
  el: '#app',
  data: {
    books: [
      { name: '《三国演义》'},
      { name: '《水浒传》'},
      { name: '《红楼梦》'},
      { name: '《西游记》'},
    ]
  }
})
</script>
</body>
</html>

输出:

5FF5DA0E-FEEC-4FB2-9B33-8224191DB06F