Skip to content

Commit 2cae74e

Browse files
authored
Create index2.html
1 parent 728a62d commit 2cae74e

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>v-if的使用</title>
6+
<script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
7+
</head>
8+
<body>
9+
<div id="app">
10+
<div v-for="(value, index) in sites">
11+
<p v-if="index % 2 != 0">
12+
{{'索引值:' + index + ' --- 每一项:' + value}}
13+
</p>
14+
</div>
15+
</div>
16+
17+
<script>
18+
new Vue({
19+
el: '#app',
20+
data: {
21+
sites: [1, 2, 3, 4, 5, 6]
22+
}
23+
})
24+
</script>
25+
</body>
26+
</html>

0 commit comments

Comments
 (0)