<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="../js/vue@2.7.16.js"></script>
    <title>10-列表渲染</title>
</head>

<body>
    <div id="app">
        <ul>
            <!-- 可以遍历数组、对象、字符串 -->
            <li v-for="(item,index) in list" :key="index">
                {{item}}--{{item.name}}--{{index}}
            </li>
        </ul>
        <br>
        <ul>
            <li v-for="(item,index) of person" :key="index ">
                {{item}}--{{index}}
            </li>
        </ul>
    </div>
</body>

<script>
    const vm = new Vue({
        el: "#app",
        data: {
            list: [
                { id: 1, name: "1" },
                { id: 2, name: "2" },
                { id: 3, name: "3" },
                { id: 4, name: "4" },
            ],
            person: {
                name: "Bunny",
                age: 16
            }
        }
    })
</script>

</html>