File tree Expand file tree Collapse file tree 1 file changed +4
-15
lines changed
Expand file tree Collapse file tree 1 file changed +4
-15
lines changed Original file line number Diff line number Diff line change 11<template >
22 <div class =" md-tabs" :class =" [themeClass, tabClasses]" >
3- <md-whiteframe md-tag =" nav" class =" md-tabs-navigation" :md-elevation =" mdElevation" :class =" navigationClasses" ref = " tabNavigation " >
3+ <md-whiteframe md-tag =" nav" class =" md-tabs-navigation" :md-elevation =" mdElevation" :class =" navigationClasses" >
44 <button
55 v-for =" header in tabList"
66 :key =" header.id"
121121 },
122122 observeElementChanges () {
123123 this .contentObserver = new MutationObserver (this .calculateOnWatch );
124- this .navigationObserver = new MutationObserver (this .calculateOnWatch );
125- this .contentObserver .observe (this .$refs .tabContent , {
124+ this .contentObserver .observe (this .$parent .$el , {
126125 childList: true ,
127126 attributes: true ,
128127 characterData: true ,
129- subtree: true ,
130- attributeOldValue: true ,
131- characterDataOldValue: true
132- });
133- this .navigationObserver .observe (this .$refs .tabNavigation .$el , {
134- attributes: true
128+ subtree: true
135129 });
136130 },
137131 getTabIndex (id ) {
152146 },
153147 calculateTabsWidthAndPosition () {
154148 const width = this .$el .offsetWidth ;
149+ let index = 0 ;
155150
156151 this .contentWidth = width * this .activeTabNumber + ' px' ;
157152
158- let index = 0 ;
159-
160153 for (const tabId in this .tabList ) {
161154 let tab = this .tabList [tabId];
162155
219212 this .contentObserver .disconnect ();
220213 }
221214
222- if (this .navigationObserver ) {
223- this .navigationObserver .disconnect ();
224- }
225-
226215 window .removeEventListener (' resize' , this .calculateOnWatch );
227216 }
228217 };
You can’t perform that action at this time.
0 commit comments