首页 > 代码库 > vuejs17-v-for指令

vuejs17-v-for指令

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<title></title>

</head>

<body>

<div id="app">

        <ul id="example-2">

        <li v-for="item in items">

        {{parentMessage}} - {{$index}} - {{item.message}}

        </li>

        </ul>

    </div>

<script src="http://static.runoob.com/assets/vue/1.0.11/vue.min.js"></script>

<script>

var example2 = new Vue({

el:‘#example-2‘,

data:{

parentMessage:‘my‘,

items:[

{message:‘Learn JavaScript‘},

{message:‘Learn Vue.js‘}

]

}

});

</script>

</body>

</html>


本文出自 “素颜” 博客,请务必保留此出处http://suyanzhu.blog.51cto.com/8050189/1895529

vuejs17-v-for指令