效果图
单击按钮逐次进行下一步

代码
<!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>步骤条</title>
<script src='./js/vue.js'></script>
<style>
* {
margin: 0;
padding: 0;
list-style: none;
text-decoration: none;
}
#app {
position: relative;
width: 880px;
height: 400px;
padding: 100px;
margin: 100px auto;
box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
box-sizing: border-box;
}
#app button {
width: 100px;
height: 40px

文章展示了一个使用Vue.js编写的步骤条组件,当点击按钮时,步骤条会按顺序改变激活状态。代码中定义了组件模板、数据和方法,通过active属性控制当前步骤,并用CSS定义了不同状态下的样式。
最低0.47元/天 解锁文章
943

被折叠的 条评论
为什么被折叠?



