一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

bootstrap vue.js实现tab效果

时间:2017-03-17 编辑:简简单单 来源:一聚教程网

项目目录结构

Student.js代码

 代码如下 复制代码

functionStudent(){

  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){

 varidx = filter;

 if(typeoffilter =='function'){

  for(vari=0;i

   if(filter(this[i],i)) idx = i;

  }

 }

 this.splice(idx,1)

}

 

varary=[{id:1,name:"b"},{id:2,name:"b"}];

vardelid = 2;

ary.del(function(obj){

 returnobj.id == delid;

})

html页

            姓名

            {{baseInfo.name}}

            性别

            {{baseInfo.sex}}

          

        

 代码如下 复制代码

  

  

  Student Management

  

  

  

  

  

    

      基本信息

      

  • 家长信息
  •       

  • 成绩查询
  •     

        

          

            

              

          

          

            

              

                父亲名

                {{parentsInfo.fatherName}}

                母亲名

                {{parentsInfo.motherName}}

              

            

          

          

            

              

                全班排名

                {{studySituation.classSort}}

                全级排名

                {{studySituation.gradeSort}}

              

            

          

        

      

    相关文章

    热门栏目