File tree Expand file tree Collapse file tree 5 files changed +34
-20
lines changed Expand file tree Collapse file tree 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>({
242242 text : 'Pagination' ,
243243 link : `/${ pkg . config . version_short } /components/pagination.html` ,
244244 } ,
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+ } ,
245254 {
246255 text : 'Popover' ,
247256 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'
44import type { RouteLocationNormalizedLoaded } from 'vue-router'
55import type { ResolvedSidebarItem } from '../../shared'
66
7- import { CNavGroup , CNavItem , CSidebarNav } from './../../../../../../src'
7+ import { CBadge , CNavGroup , CNavItem , CSidebarNav } from './../../../../../../src'
88import { CIcon } from '@coreui/icons-vue'
99
1010const normalizePath = ( path : string ) : string =>
@@ -76,20 +76,28 @@ const renderItem = (item: ResolvedSidebarItem): VNode => {
7676 CNavItem ,
7777 {
7878 active : props . isActive ,
79+ disabled : item . disabled ,
7980 href : item . link ,
8081 } ,
8182 {
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+ ] ,
8395 } ,
8496 ) ,
8597 } ,
8698 )
8799}
88100
89- // export default defineComponent({
90-
91- // })
92-
93101export const SidebarNav = ( { items } ) => {
94102 return h (
95103 CSidebarNav ,
Original file line number Diff line number Diff line change @@ -96,18 +96,6 @@ export default defineComponent({
9696 frontmatter .value .pageClass ,
9797 ])
9898
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-
11199 // handle scrollBehavior with transition
112100 const scrollPromise = useScrollPromise ()
113101 const onBeforeEnter = scrollPromise .resolve
Original file line number Diff line number Diff line change 11.docs-sidebar {
22 --cui-sidebar-bg : #f0f4f7 ;
33 --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 );
66 --cui-sidebar-nav-link-active-color : #321fdb ;
77 --cui-sidebar-nav-link-hover-color : #321fdb ;
88 --cui-sidebar-nav-group-bg : transparent ;
99 --cui-sidebar-nav-group-toggle-show-color : #321fdb ;
10+ --cui-sidebar-nav-link-disabled-color : #{$text-disabled } ;
1011}
Original file line number Diff line number Diff line change 11/**
22 * Base nav item, displayed as text
33 */
4+
5+ type Badge = {
6+ color : string ,
7+ text : string
8+ }
49export interface NavItem {
10+ badge ?: Badge
11+ disabled ?: boolean
12+ icon ?: string
513 text : string
614 ariaLabel ?: string
715}
You can’t perform that action at this time.
0 commit comments