-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: 拖动排序和Tab记忆功能一起启用时拖动后应该也保持拖动后的顺序 (#1)
Signed-off-by: ajiho <lujiahao@88.com>
- Loading branch information
Showing
6 changed files
with
199 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!DOCTYPE html> | ||
<html lang="zh"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Document</title> | ||
<link rel="stylesheet" href="dist/css/quicktab.css"> | ||
|
||
</head> | ||
|
||
<body> | ||
|
||
<button onclick="add()">添加Tab</button> | ||
<div id="qtab"></div> | ||
|
||
<script src="dist/js/quicktab.js"></script> | ||
<script> | ||
|
||
const tab = new Quicktab('#qtab', { | ||
id:'qtab', | ||
defaultTabs: [ | ||
{ | ||
title:'欢迎页面1', | ||
url: 'welcome.html' | ||
}, | ||
{ | ||
title:'欢迎页面2', | ||
url: 'welcome.html?id=10' | ||
} | ||
], | ||
tab:{ | ||
dragSort:true, | ||
remember:true, | ||
} | ||
}) | ||
|
||
function add(){ | ||
tab.addTab({ | ||
title:'新标签'+Math.random(), | ||
url:'welcome.html?id='+ Math.random() | ||
}) | ||
} | ||
|
||
</script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!DOCTYPE html> | ||
<html lang="zh"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Document</title> | ||
<link rel="stylesheet" href="dist/css/quicktab.css"> | ||
|
||
</head> | ||
|
||
<body> | ||
|
||
<button onclick="add()">添加Tab</button> | ||
<div id="qtab"></div> | ||
|
||
<script src="dist/js/quicktab.js"></script> | ||
<script> | ||
|
||
const tab = new Quicktab('#qtab', { | ||
id:'qtab', | ||
defaultTabs: [ | ||
{ | ||
title:'欢迎页面1', | ||
url: 'welcome.html' | ||
}, | ||
{ | ||
title:'欢迎页面2', | ||
url: 'welcome.html?id=10' | ||
} | ||
], | ||
tab:{ | ||
dragSort:true, | ||
remember:true, | ||
} | ||
}) | ||
|
||
function add(){ | ||
tab.addTab({ | ||
title:'新标签'+Math.random(), | ||
url:'welcome.html?id='+ Math.random() | ||
}) | ||
} | ||
|
||
</script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<!DOCTYPE html> | ||
<html lang="zh"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Document</title> | ||
<link rel="stylesheet" href="dist/css/quicktab.css"> | ||
|
||
<style> | ||
|
||
.container{ | ||
position: fixed; | ||
/* height: 10px; */ | ||
inset: 0; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
|
||
|
||
|
||
|
||
<div class="container"> | ||
<div id="qtab"></div> | ||
</div> | ||
|
||
|
||
|
||
<script src="dist/js/quicktab.js"></script> | ||
<script> | ||
// 1.父元素的样式如果是设置的固定定位或者绝对定位时也没有设置固定高度 | ||
// 2.同时选项的高度设置100%时 会引发该bug | ||
|
||
const tab = new Quicktab('#qtab',{ | ||
defaultTabs:[ | ||
{ | ||
url:'welcome.html' | ||
}, | ||
{ | ||
url:'welcome.html?id=10' | ||
} | ||
], | ||
|
||
height:'100%', | ||
toolbar:{ | ||
dropdown:{ | ||
enable:true//启用下拉菜单 | ||
} | ||
} | ||
}) | ||
|
||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters