Replies: 1 comment
-
目前自定义 tab 元素时,除了切换事件监听,其他的 API 都要自行实现。参考下面简易的实现,注意这个示例是用其他演示代码修改的,请根据需求做一些合理的改动。 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
tabAdd: function(){
// 新增一个 tab 项
var label = (Math.random()*1000|0); // 标记 - 用于演示
element.tabAdd('test-handle', {
title: '新选项'+ label,
content: '内容-'+ label,
id: new Date().getTime(), // 实际使用一般是规定好的id,这里以毫秒数模拟
change: true // 是否添加完毕后即自动切换
})
}, 这个方法应该不适用这个自定义的tab。 我自己用了jq去新增,但是切换tab的时候,会触发多次的请求方法。
Beta Was this translation helpful? Give feedback.
All reactions