<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>v-bind</title>
<script src="https://cdn.jsdelivr.net/npm/vue@2.7.14/dist/vue.js"></script>
<style type="text/css">
a{
background-color: #ffffff;
}
a{
font-size: 10px;
margin-top: 10px;
width: 300px;
height: 300px;
}
</style>
</head>
<body>
<div id="app">
<ul>
<li v-for="(item,index) in list" :key="item.id" @click="activeindex=index">
<a class="{active: index===activeindex}" href="">{{item.name}}</a>
</li>
</ul>
</div>
<script>
var app = new Vue({
el: '#app',
data: {
activeindex:0,//高亮
list:[
{id:1, name:"京东秒杀"},
{id:2, name:"每日特价"},
{id:3, name:"品类秒杀"},
]
},
methods: {
}
})
</script>
</body>
</html>
文章来源地址https://www.toymoban.com/news/detail-691380.html
文章来源:https://www.toymoban.com/news/detail-691380.html
到了这里,关于v-bind对样式控制增强的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!