File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
src/components/scroll-nav Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 8181 return {
8282 scrollEvents: [' scroll' , ' scroll-end' ],
8383 scrollY: 0 ,
84- labels: [],
85- barTxts: [],
84+ panels: [],
8685 active: this .current ,
8786 pageStickyOffset: 0
8887 }
8988 },
9089 computed: {
90+ labels () {
91+ return this .panels .map ((panel ) => panel .label )
92+ },
93+ barTxts () {
94+ return this .panels .map ((panel ) => panel .title )
95+ },
9196 barDirection () {
9297 return this .side ? DIRECTION_V : DIRECTION_H
9398 }
104109 },
105110 created () {
106111 this .navBar = null
107- this .panels = []
108112 this .stickyCurrent = this .current
109113 },
110114 mounted () {
189193 },
190194 addPanel (panel ) {
191195 this .panels .push (panel)
192- this .labels .push (panel .label )
193- this .barTxts .push (panel .title )
194196 },
195197 removePanel (panel ) {
196198 const i = this .panels .indexOf (panel)
197199 this .panels .splice (i, 1 )
198- this .labels .splice (i, 1 )
199- this .barTxts .splice (i, 1 )
200200 }
201201 },
202202 components: {
You can’t perform that action at this time.
0 commit comments