bootstrap vue.js实现tab效果

bootstrap vue.js实现tab效果

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 content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <title>Student Management</title> <link type="text/css" href="https://cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css" > <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> <ul> <li><a href="#" >基本信息</a></li> <li><a href="#" >家长信息</a></li> <li><a href="#" >成绩查询</a></li> </ul> <div> <div> <table> <tr> <td>姓名</td> <td>{{baseInfo.name}}</td> <td>性别</td> <td>{{baseInfo.sex}}</td> </tr> </table> </div> <div> <table> <tr> <td>父亲名</td> <td>{{parentsInfo.fatherName}}</td> <td>母亲名</td> <td>{{parentsInfo.motherName}}</td> </tr> </table> </div> <div> <table> <tr> <td>全班排名</td> <td>{{studySituation.classSort}}</td> <td>全级排名</td> <td>{{studySituation.gradeSort}}</td> </tr> </table> </div> </div> </div> </body> <script src="https://www.jb51.net/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>

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wwgfgs.html