列表过滤

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<script src="../js/vue.js"></script>
<body>
    <div id="root">
        <h1>数组遍历</h1>
        <li v-for="p in person" :key="p.id">
            {{p.name}} - {{p.age}}
        </li>
    </div>
</body>

<script  type="text/javascript">
    Vue.config.productionTip = false

    new Vue({
        el:'#root',
        data:{
            ***--
            person:[
                {id:001,name:'周冬雨',age:'18'},
                {id:002,name:'马冬梅',age:'21'},
                {id:003,name:'周杰伦',age:'21'},
            ],
        }
    })
</script>
</html>
posted @ 2022-01-04 21:24  爽爽子的秃头生活  阅读(15)  评论(0)    收藏  举报