当前位置: 移动技术网 > IT编程>脚本编程>vue.js > bootstrap vue.js实现tab效果

bootstrap vue.js实现tab效果

2018年05月07日  | 移动技术网IT编程  | 我要评论

残血罗刹国,我是蒋干,转生剑侠

本文实例为大家分享了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 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" href="https://cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.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>

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持移动技术网。

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网