@@ -217,7 +217,7 @@ const removeTab = (tab) => {
217217 const index = historys .value .findIndex (
218218 (item ) => getFmtString (item) === tab
219219 )
220- if (getFmtString (route) === tab) {
220+ if (getFmtString (route) === tab) {
221221 if (historys .value .length === 1 ) {
222222 router .push ({ name: defaultRouter .value })
223223 } else {
@@ -239,7 +239,7 @@ const removeTab = (tab) => {
239239 historys .value .splice (index, 1 )
240240}
241241
242- watch (contextMenuVisible, () => {
242+ watch (() => contextMenuVisible . value , () => {
243243 if (contextMenuVisible .value ) {
244244 document .body .addEventListener (' click' , () => {
245245 contextMenuVisible .value = false
@@ -251,15 +251,15 @@ watch(contextMenuVisible, () => {
251251 }
252252})
253253
254- watch (route, (to , now ) => {
254+ watch (() => route, (to , now ) => {
255255 if (to .name === ' Login' || to .name === ' Reload' ) {
256256 return
257257 }
258258 historys .value = historys .value .filter ((item ) => ! item .meta .closeTab )
259259 setTab (to)
260260 sessionStorage .setItem (' historys' , JSON .stringify (historys .value ))
261261 activeValue .value = window .sessionStorage .getItem (' activeValue' )
262- })
262+ }, { deep : true } )
263263
264264watch (() => historys .value , () => {
265265 sessionStorage .setItem (' historys' , JSON .stringify (historys .value ))
0 commit comments