<!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>
<style>
.content {
background-color: aqua;
}
.f {
background-color: brown;
}
</style>
<body>
<div class="box">
<ul>
<li v-for="i in 100" :class="{content:i%2==0,f:i%2!==0}">
{{i}}
</li>
</ul>
</div>
</body>
<script src="./vue2/vue.min.js "></script>
<script>
new Vue({
el: ".box ",
data: {
}
})
</script>
</html>
vue.js实现简单的隔行变色
最新推荐文章于 2024-04-29 17:14:49 发布