File tree Expand file tree Collapse file tree 2 files changed +29
-9
lines changed
dev/components/components
src/components/breadcrumbs Expand file tree Collapse file tree 2 files changed +29
-9
lines changed Original file line number Diff line number Diff line change 66 <br >
77 If window is wide enough then labels are also displayed.
88 </p >
9+ <q-toggle v-model =" first" label =" first" />
10+ <q-toggle v-model =" second" label =" second" />
11+ <q-toggle v-model =" third" label =" third" />
12+ <br ><br >
913 <q-breadcrumbs >
10- <q-breadcrumbs-el label =" Home" icon =" home" />
11- <q-breadcrumbs-el label =" Components" icon =" widgets" />
12- <q-breadcrumbs-el label =" Breadcrumbs" icon =" navigation" />
14+ <q-breadcrumbs-el v-if = " first " label =" Home" icon =" home" />
15+ <q-breadcrumbs-el v-if = " second " label =" Components" icon =" widgets" />
16+ <q-breadcrumbs-el v-if = " third " label =" Breadcrumbs" icon =" navigation" />
1317 </q-breadcrumbs >
18+
1419 <br ><br >
1520 <q-breadcrumbs icon-separator =" chevron_right" active-color =" secondary" color =" light" >
1621 <q-breadcrumbs-el label =" Home" to =" /" />
3540 </div >
3641 </div >
3742</template >
43+
44+ <script >
45+ export default {
46+ data () {
47+ return {
48+ first: true ,
49+ second: true ,
50+ third: true
51+ }
52+ }
53+ }
54+ </script >
Original file line number Diff line number Diff line change @@ -26,20 +26,23 @@ export default {
2626 }
2727 } ,
2828 render ( h ) {
29+ if ( ! this . $slots . default ) {
30+ return
31+ }
32+
2933 const
3034 child = [ ] ,
31- length = this . $slots . default . length - 1 ,
35+ len = this . $slots . default . filter ( c => c . tag !== void 0 && c . tag . endsWith ( '-QBreadcrumbsEl' ) ) . length ,
3236 separator = this . $scopedSlots . separator || ( ( ) => this . separator ) ,
3337 color = `text-${ this . color } ` ,
3438 active = `text-${ this . activeColor } `
39+ let els = 1
3540
3641 for ( const i in this . $slots . default ) {
3742 const comp = this . $slots . default [ i ]
38- if (
39- comp . componentOptions &&
40- [ 'q-breadcrumbs-el' , 'QBreadcrumbsEl' , 'qBreadcrumbsEl' ] . includes ( comp . componentOptions . tag )
41- ) {
42- const middle = i < length
43+ if ( comp . tag !== void 0 && comp . tag . endsWith ( '-QBreadcrumbsEl' ) ) {
44+ const middle = els < len
45+ els ++
4346
4447 child . push ( h ( 'div' , {
4548 'class' : [ middle ? active : color , middle ? 'text-weight-bold' : 'q-breadcrumbs-last' ]
You can’t perform that action at this time.
0 commit comments