bootstrap vue.js實(shí)現(xiàn)tab效果
本文實(shí)例為大家分享了bootstrap vue.js實(shí)現(xiàn)tab效果的具體代碼,供大家參考,具體內(nèi)容如下
項(xiàng)目目錄結(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頁(yè)
<!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" >家長(zhǎng)信息</a></li> <li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" >成績(jī)查詢</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">全級(jí)排名</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>
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
Vue數(shù)據(jù)監(jiān)聽(tīng)方法watch的使用
這篇文章主要介紹了Vue數(shù)據(jù)監(jiān)聽(tīng)方法watch的使用,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2018-03-03vue3+element?plus實(shí)現(xiàn)側(cè)邊欄過(guò)程
這篇文章主要介紹了vue3+element?plus實(shí)現(xiàn)側(cè)邊欄過(guò)程,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2024-03-03詳解@Vue/Cli 3 Invalid Host header 錯(cuò)誤解決辦法
這篇文章主要介紹了詳解@Vue/Cli 3 Invalid Host header 錯(cuò)誤解決辦法,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2019-01-01Vue實(shí)現(xiàn)自定義組件改變組件背景色(示例代碼)
要實(shí)現(xiàn) Vue 自定義組件改變組件背景色,你可以通過(guò) props 將背景色作為組件的一個(gè)屬性傳遞給組件,在組件內(nèi)部監(jiān)聽(tīng)這個(gè)屬性的變化,并將其應(yīng)用到組件的樣式中,下面通過(guò)示例代碼介紹Vue如何實(shí)現(xiàn)自定義組件改變組件背景色,感興趣的朋友一起看看吧2024-03-03vue中watch的實(shí)際開(kāi)發(fā)學(xué)習(xí)筆記
watch是Vue實(shí)例的一個(gè)屬性是用來(lái)響應(yīng)數(shù)據(jù)的變化,需要在數(shù)據(jù)變化時(shí)執(zhí)行異步或開(kāi)銷較大的操作時(shí),這個(gè)方式是最有用的,下面這篇文章主要給大家介紹了關(guān)于vue中watch的實(shí)際開(kāi)發(fā)筆記,需要的朋友可以參考下2022-11-11vue中watch監(jiān)聽(tīng)路由傳來(lái)的參數(shù)變化問(wèn)題
這篇文章主要介紹了vue中watch監(jiān)聽(tīng)路由傳來(lái)的參數(shù)變化,本文通過(guò)實(shí)例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2023-07-07Vue實(shí)現(xiàn)搜索結(jié)果高亮顯示關(guān)鍵字
這篇文章主要為大家詳細(xì)介紹了Vue實(shí)現(xiàn)搜索結(jié)果高亮顯示關(guān)鍵字,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2019-05-05vue實(shí)現(xiàn)移動(dòng)端的開(kāi)關(guān)按鈕
這篇文章主要為大家詳細(xì)介紹了vue實(shí)現(xiàn)移動(dòng)端的開(kāi)關(guān)按鈕,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2022-02-02vue引入新版 vue-awesome-swiper插件填坑問(wèn)題
這篇文章主要介紹了vue引入新版 vue-awesome-swiper插件填坑問(wèn)題,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2018-01-01Antd的Table組件嵌套Table以及選擇框聯(lián)動(dòng)操作
這篇文章主要介紹了Antd的Table組件嵌套Table以及選擇框聯(lián)動(dòng)操作,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2020-10-10