File tree 5 files changed +34
-20
lines changed
5 files changed +34
-20
lines changed Original file line number Diff line number Diff line change @@ -242,6 +242,15 @@ export default defineUserConfig<DefaultThemeOptions>({
242
242
text : 'Pagination' ,
243
243
link : `/${ pkg . config . version_short } /components/pagination.html` ,
244
244
} ,
245
+ {
246
+ text : 'Placeholders' ,
247
+ link : `/${ pkg . config . version_short } /components/placeholders.html` ,
248
+ disabled : true ,
249
+ badge : {
250
+ color : 'warning' ,
251
+ text : 'WIP v4.1' ,
252
+ }
253
+ } ,
245
254
{
246
255
text : 'Popover' ,
247
256
link : `/${ pkg . config . version_short } /components/popover.html` ,
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { RouterLink, useRoute } from 'vue-router'
4
4
import type { RouteLocationNormalizedLoaded } from 'vue-router'
5
5
import type { ResolvedSidebarItem } from '../../shared'
6
6
7
- import { CNavGroup , CNavItem , CSidebarNav } from './../../../../../../src'
7
+ import { CBadge , CNavGroup , CNavItem , CSidebarNav } from './../../../../../../src'
8
8
import { CIcon } from '@coreui/icons-vue'
9
9
10
10
const normalizePath = ( path : string ) : string =>
@@ -76,20 +76,28 @@ const renderItem = (item: ResolvedSidebarItem): VNode => {
76
76
CNavItem ,
77
77
{
78
78
active : props . isActive ,
79
+ disabled : item . disabled ,
79
80
href : item . link ,
80
81
} ,
81
82
{
82
- default : ( ) => item . text ,
83
+ default : ( ) => [
84
+ item . text ,
85
+ item . badge &&
86
+ h (
87
+ CBadge ,
88
+ {
89
+ class : 'ms-auto' ,
90
+ color : item . badge . color ,
91
+ } ,
92
+ item . badge . text ,
93
+ ) ,
94
+ ] ,
83
95
} ,
84
96
) ,
85
97
} ,
86
98
)
87
99
}
88
100
89
- // export default defineComponent({
90
-
91
- // })
92
-
93
101
export const SidebarNav = ( { items } ) => {
94
102
return h (
95
103
CSidebarNav ,
Original file line number Diff line number Diff line change @@ -96,18 +96,6 @@ export default defineComponent({
96
96
frontmatter .value .pageClass ,
97
97
])
98
98
99
- // close sidebar after navigation
100
- let unregisterRouterHook
101
- onMounted (() => {
102
- const router = useRouter ()
103
- unregisterRouterHook = router .afterEach (() => {
104
- toggleSidebar (false )
105
- })
106
- })
107
- onUnmounted (() => {
108
- unregisterRouterHook ()
109
- })
110
-
111
99
// handle scrollBehavior with transition
112
100
const scrollPromise = useScrollPromise ()
113
101
const onBeforeEnter = scrollPromise .resolve
Original file line number Diff line number Diff line change 1
1
.docs-sidebar {
2
2
--cui-sidebar-bg : #f0f4f7 ;
3
3
--cui-sidebar-brand-bg : transparent ;
4
- --cui-sidebar-brand-color : rgba (44 , 56 , 74 , 0.95 );
5
- --cui-sidebar-nav-link-color : rgba (44 , 56 , 74 , 0.95 );
4
+ --cui-sidebar-brand-color : rgba (44 ,56 ,74 ,0.87 );
5
+ --cui-sidebar-nav-link-color : rgba (44 ,56 ,74 ,0.87 );
6
6
--cui-sidebar-nav-link-active-color : #321fdb ;
7
7
--cui-sidebar-nav-link-hover-color : #321fdb ;
8
8
--cui-sidebar-nav-group-bg : transparent ;
9
9
--cui-sidebar-nav-group-toggle-show-color : #321fdb ;
10
+ --cui-sidebar-nav-link-disabled-color : #{$text-disabled } ;
10
11
}
Original file line number Diff line number Diff line change 1
1
/**
2
2
* Base nav item, displayed as text
3
3
*/
4
+
5
+ type Badge = {
6
+ color : string ,
7
+ text : string
8
+ }
4
9
export interface NavItem {
10
+ badge ?: Badge
11
+ disabled ?: boolean
12
+ icon ?: string
5
13
text : string
6
14
ariaLabel ?: string
7
15
}
You can’t perform that action at this time.
0 commit comments