This commit is contained in:
xaoxuu 2021-07-10 11:12:11 +08:00
parent c753b3dfbc
commit 3432128c94
2 changed files with 9 additions and 5 deletions

View File

@ -28,7 +28,7 @@ module.exports = ctx => function(args, content) {
} }
}); });
args = ctx.args.map(args, ['active', 'center'], ['tabName']); args = ctx.args.map(args, ['active', 'align'], ['tabName']);
const tabName = args.tabName; const tabName = args.tabName;
const tabActive = Number(args.active) || 0; const tabActive = Number(args.active) || 0;
@ -52,8 +52,8 @@ module.exports = ctx => function(args, content) {
tabContent = `<div class="tab-content">${tabContent}</div>`; tabContent = `<div class="tab-content">${tabContent}</div>`;
el += '<div class="tag-plugin tabs"'; el += '<div class="tag-plugin tabs"';
if (args.center === 'true') { if (args.align !== undefined) {
el += ' center="true"'; el += ' align="' + args.align + '"';
} }
el += 'id="' + tabName.toLowerCase().split(' ').join('-') + '"'; el += 'id="' + tabName.toLowerCase().split(' ').join('-') + '"';
el += '">'; el += '">';

View File

@ -4,13 +4,16 @@
margin-bottom: 1rem margin-bottom: 1rem
display: flex display: flex
flex-direction: column flex-direction: column
&[center] align-items: flex-start
&[align=center]
align-items: center align-items: center
&[align=right]
align-items: flex-end
.tag-plugin.tabs .tag-plugin.tabs
ul.nav-tabs ul.nav-tabs
display: flex display: flex
align-self: center // align-self: center
overflow: scroll visible overflow: scroll visible
scrollbar(0, 0) scrollbar(0, 0)
max-width: 100% max-width: 100%
@ -64,6 +67,7 @@
.tab-content .tab-content
max-width: 100% max-width: 100%
text-align: justify
.tab-pane .tab-pane
&:not(.active) &:not(.active)
display: none display: none