新增:增加全局关闭页面api: $closePage(closeRoute, nextRoute);master
							parent
							
								
									9c10453f97
								
							
						
					
					
						commit
						c10ea64ba7
					
				
				 4 changed files with 37 additions and 9 deletions
			
			
		@ -1,10 +1,12 @@ | 
				
			||||
import VueI18nPlugin from '@/plugins/i18n-extend' | 
				
			||||
import AuthorityPlugin from '@/plugins/authority-plugin' | 
				
			||||
import VueI18nPlugin from './i18n-extend' | 
				
			||||
import AuthorityPlugin from './authority-plugin' | 
				
			||||
import TabsPagePlugin from './tabs-page-plugin' | 
				
			||||
 | 
				
			||||
const Plugins = { | 
				
			||||
  install: function (Vue) { | 
				
			||||
    Vue.use(VueI18nPlugin) | 
				
			||||
    Vue.use(AuthorityPlugin) | 
				
			||||
    Vue.use(TabsPagePlugin) | 
				
			||||
  } | 
				
			||||
} | 
				
			||||
export default Plugins | 
				
			||||
 | 
				
			||||
@ -0,0 +1,14 @@ | 
				
			||||
const TabsPagePlugin = { | 
				
			||||
  install(Vue) { | 
				
			||||
    Vue.mixin({ | 
				
			||||
      methods: { | 
				
			||||
        $closePage(closeRoute, nextRoute) { | 
				
			||||
          const event = new CustomEvent('page:close', {detail:{closeRoute, nextRoute}}) | 
				
			||||
          window.dispatchEvent(event) | 
				
			||||
        } | 
				
			||||
      } | 
				
			||||
    }) | 
				
			||||
  } | 
				
			||||
} | 
				
			||||
 | 
				
			||||
export default TabsPagePlugin | 
				
			||||
					Loading…
					
					
				
		Reference in new issue