bootstrap vue.js實現(xiàn)tab效果
本文實例為大家分享了bootstrap vue.js實現(xiàn)tab效果的具體代碼,供大家參考,具體內(nèi)容如下
項目目錄結(jié)構(gòu)

Student.js代碼
function Student(){
this.baseInfo = {
tabStatus : true ,
name : '張三',
sex : 'male'
} ,
this.parentsInfo = {
tabStatus : false,
fatherName : '張全蛋',
motherName : '李鐵柱'
} ,
this.studySituation = {
tabStatus : false,
classSort : 1,
gradeSort : 2
}
}
CommonUtil.js代碼
Array.prototype.del = function(filter){
var idx = filter;
if(typeof filter == 'function'){
for(var i=0;i<this.length;i++){
if(filter(this[i],i)) idx = i;
}
}
this.splice(idx,1)
}
var ary=[{id:1,name:"b"},{id:2,name:"b"}];
var delid = 2;
ary.del(function(obj){
return obj.id == delid;
})
html頁
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Student Management</title>
<link rel="stylesheet" type="text/css" rel="external nofollow" >
<script src="https://cdn.bootcss.com/jquery/3.1.1/jquery.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="https://unpkg.com/vue/dist/vue.js"></script>
</head>
</head>
<body>
<div id="stu" class="container">
<ul class="nav nav-tabs">
<li class="active"><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" >基本信息</a></li>
<li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" >家長信息</a></li>
<li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" >成績查詢</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane fade in active">
<table class="table">
<tr>
<td class="col-lg-2">姓名</td>
<td class="col-lg-4">{{baseInfo.name}}</td>
<td class="col-lg-2">性別</td>
<td class="col-lg-4">{{baseInfo.sex}}</td>
</tr>
</table>
</div>
<div class="tab-pane fade in">
<table class="table">
<tr>
<td class="col-lg-2">父親名</td>
<td class="col-lg-4">{{parentsInfo.fatherName}}</td>
<td class="col-lg-2">母親名</td>
<td class="col-lg-4">{{parentsInfo.motherName}}</td>
</tr>
</table>
</div>
<div class="tab-pane fade in">
<table class="table">
<tr>
<td class="col-lg-2">全班排名</td>
<td class="col-lg-4">{{studySituation.classSort}}</td>
<td class="col-lg-2">全級排名</td>
<td class="col-lg-4">{{studySituation.gradeSort}}</td>
</tr>
</table>
</div>
</div>
</div>
</body>
<script src="js/Student.js"></script>
<script>
var student = new Student();
new Vue({
el : '#stu',
data : {
baseInfo : student.baseInfo,
parentsInfo : student.parentsInfo,
studySituation : student.studySituation
} ,
method : {
}
})
</script>
</html>
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
Vue數(shù)據(jù)監(jiān)聽方法watch的使用
這篇文章主要介紹了Vue數(shù)據(jù)監(jiān)聽方法watch的使用,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2018-03-03
vue3+element?plus實現(xiàn)側(cè)邊欄過程
這篇文章主要介紹了vue3+element?plus實現(xiàn)側(cè)邊欄過程,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教2024-03-03
詳解@Vue/Cli 3 Invalid Host header 錯誤解決辦法
這篇文章主要介紹了詳解@Vue/Cli 3 Invalid Host header 錯誤解決辦法,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2019-01-01
vue中watch的實際開發(fā)學(xué)習(xí)筆記
watch是Vue實例的一個屬性是用來響應(yīng)數(shù)據(jù)的變化,需要在數(shù)據(jù)變化時執(zhí)行異步或開銷較大的操作時,這個方式是最有用的,下面這篇文章主要給大家介紹了關(guān)于vue中watch的實際開發(fā)筆記,需要的朋友可以參考下2022-11-11
vue中watch監(jiān)聽路由傳來的參數(shù)變化問題
這篇文章主要介紹了vue中watch監(jiān)聽路由傳來的參數(shù)變化,本文通過實例代碼給大家介紹的非常詳細,對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下2023-07-07
Vue實現(xiàn)搜索結(jié)果高亮顯示關(guān)鍵字
這篇文章主要為大家詳細介紹了Vue實現(xiàn)搜索結(jié)果高亮顯示關(guān)鍵字,具有一定的參考價值,感興趣的小伙伴們可以參考一下2019-05-05
vue引入新版 vue-awesome-swiper插件填坑問題
這篇文章主要介紹了vue引入新版 vue-awesome-swiper插件填坑問題,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2018-01-01
Antd的Table組件嵌套Table以及選擇框聯(lián)動操作
這篇文章主要介紹了Antd的Table組件嵌套Table以及選擇框聯(lián)動操作,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2020-10-10

