bootstrap-tab
bootstrap-tab组件是对原生的bootstrap-tab组件的封装,方便开发者更方便地使用,主要包含以下功能:
tab页初始化 关闭tab页 新增tab 显示tab页 获取tab页ID
使用
Step1 :引入样式
Step2:引入脚本
Step3:使用
参数和方法说明
参数说明
Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; border-right: rgb(238,238) 1px solid; vertical-align: top; background: none transparent scroll repeat 0% 0%; border-bottom: rgb(238,238) 1px solid; outline-width: 0px; padding-bottom: 8px; text-align: left; padding-top: 8px; outline-style: none; padding-left: 8px; margin: 0px; border-left: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">参数名称 | Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">默认值 | Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">可选值 | Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">说明 | |||
---|---|---|---|---|---|---|
Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-width: 0px; padding-bottom: 8px; padding-top: 8px; outline-style: none; padding-left: 8px; margin: 0px; border-left: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">data | Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">tab页数据来源(对象列表),包含id,text,url,closeable属性Box-sizing: border-Box; font-size: 15px; border-top: 0px; border-right: 0px; vertical-align: baseline; background: none transparent scroll repeat 0% 0%; border-bottom: 0px; outline-width: 0px; padding-bottom: 0px; padding-top: 0px; outline-style: none; padding-left: 0px; margin: 0px; border-left: 0px; outline-color: invert; padding-right: 0px">Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">id | Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">必须,单个tab的idBox-sizing: border-Box; font-size: 15px; border-top: 0px; border-right: 0px; vertical-align: baseline; background: none transparent scroll repeat 0% 0%; border-bottom: 0px; outline-width: 0px; padding-bottom: 0px; padding-top: 0px; outline-style: none; padding-left: 0px; margin: 0px; border-left: 0px; outline-color: invert; padding-right: 0px">Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">text | Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">必须,单个tab页的标题Box-sizing: border-Box; font-size: 15px; border-top: 0px; border-right: 0px; vertical-align: baseline; background: none transparent scroll repeat 0% 0%; border-bottom: 0px; outline-width: 0px; padding-bottom: 0px; padding-top: 0px; outline-style: none; padding-left: 0px; margin: 0px; border-left: 0px; outline-color: invert; padding-right: 0px">Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">url | Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">必须,单个tab页的内容urlBox-sizing: border-Box; font-size: 15px; border-top: 0px; border-right: 0px; vertical-align: baseline; background: none transparent scroll repeat 0% 0%; border-bottom: 0px; outline-width: 0px; padding-bottom: 0px; padding-top: 0px; outline-style: none; padding-left: 0px; margin: 0px; border-left: 0px; outline-color: invert; padding-right: 0px">Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">closeable | Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">falseBox-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">true,falseBox-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">单个tab页是否可关闭Box-sizing: border-Box; font-size: 15px; border-top: 0px; border-right: 0px; vertical-align: baseline; background: none transparent scroll repeat 0% 0%; border-bottom: 0px; outline-width: 0px; padding-bottom: 0px; padding-top: 0px; outline-style: none; padding-left: 0px; margin: 0px; border-left: 0px; outline-color: invert; padding-right: 0px">Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">showIndex | Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">0Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">默认显示页的索引Box-sizing: border-Box; font-size: 15px; border-top: 0px; border-right: 0px; vertical-align: baseline; background: none transparent scroll repeat 0% 0%; border-bottom: 0px; outline-width: 0px; padding-bottom: 0px; padding-top: 0px; outline-style: none; padding-left: 0px; margin: 0px; border-left: 0px; outline-color: invert; padding-right: 0px">Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">loadAll | Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">trueBox-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">true=一次全部加在页面,false=只加在showIndex指定的页面,其他点击时加载,提高响应速度
方法说明
Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">参数 | Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">参数说明 | Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">方法说明 | Box-sizing: border-Box; font-size: 15px; border-top: 0px; border-right: 0px; vertical-align: baseline; background: none transparent scroll repeat 0% 0%; border-bottom: 0px; outline-width: 0px; padding-bottom: 0px; padding-top: 0px; outline-style: none; padding-left: 0px; margin: 0px; border-left: 0px; outline-color: invert; padding-right: 0px">|||
---|---|---|---|---|---|
Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">init | Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">tab组件初始化入口方法Box-sizing: border-Box; font-size: 15px; border-top: 0px; border-right: 0px; vertical-align: baseline; background: none transparent scroll repeat 0% 0%; border-bottom: 0px; outline-width: 0px; padding-bottom: 0px; padding-top: 0px; outline-style: none; padding-left: 0px; margin: 0px; border-left: 0px; outline-color: invert; padding-right: 0px">Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">builder | Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">tab数据Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">构建tab页的主方法Box-sizing: border-Box; font-size: 15px; border-top: 0px; border-right: 0px; vertical-align: baseline; background: none transparent scroll repeat 0% 0%; border-bottom: 0px; outline-width: 0px; padding-bottom: 0px; padding-top: 0px; outline-style: none; padding-left: 0px; margin: 0px; border-left: 0px; outline-color: invert; padding-right: 0px">Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">loadData | Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">加载tab页的内容,根据loadAll即时加载或者点击时加载Box-sizing: border-Box; font-size: 15px; border-top: 0px; border-right: 0px; vertical-align: baseline; background: none transparent scroll repeat 0% 0%; border-bottom: 0px; outline-width: 0px; padding-bottom: 0px; padding-top: 0px; outline-style: none; padding-left: 0px; margin: 0px; border-left: 0px; outline-color: invert; padding-right: 0px">Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">addTab | Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">objBox-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">单个tab的数据Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">增加一个tab页Box-sizing: border-Box; font-size: 15px; border-top: 0px; border-right: 0px; vertical-align: baseline; background: none transparent scroll repeat 0% 0%; border-bottom: 0px; outline-width: 0px; padding-bottom: 0px; padding-top: 0px; outline-style: none; padding-left: 0px; margin: 0px; border-left: 0px; outline-color: invert; padding-right: 0px">Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">showTab | Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">tabIdBox-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">tab的idBox-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">根据id显示tab页Box-sizing: border-Box; font-size: 15px; border-top: 0px; border-right: 0px; vertical-align: baseline; background: none transparent scroll repeat 0% 0%; border-bottom: 0px; outline-width: 0px; padding-bottom: 0px; padding-top: 0px; outline-style: none; padding-left: 0px; margin: 0px; border-left: 0px; outline-color: invert; padding-right: 0px">Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">getCurrentTabId | Box-sizing: border-Box; font-size: 15px; border-top: rgb(238,238) 1px solid; outline-color: invert; line-height: 20px; padding-right: 8px">获取当前活动tab页的ID
相关链接
总结
以上所述是小编给大家介绍的基于Bootstrap的标签页组件及bootstrap-tab使用说明。编程之家 jb51.cc 收集整理的教程希望能对你有所帮助,如果觉得编程之家不错,可分享给好友!感谢支持。
原文链接:https://www.f2er.com/bootstrap/37605.html