<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=no,width=device-width">
<meta name="apple-mobile-web-app-title" content="Vue选项卡">
<title>Vue实现选项卡</title>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
</head>
<style>
#app{
width: 300px;
height: 350px;
margin: 100px auto;
}
button {
width: 100px;
height: 50px;
text-align: center;
border: none;
cursor: pointer;
color: #FFF;
background: #000;
}
#app>div{
height:300px;
text-align: center;
line-height: 300px;
}
.active1{
background: red;
}
.active2{
background: yellow;
color: #FFF;
}
.active3{
background: blue;
color: #FFF;
}
</style>
<body>
<div id="app">
<button
v-for="(val,key) in box"
Vue-案例-实现简单的选项卡效果
最新推荐文章于 2021-04-10 20:01:24 发布
