feat: add the api of global closing page: $closePage(closeRoute, nextRoute);🌟
新增:增加全局关闭页面api: $closePage(closeRoute, nextRoute);
This commit is contained in:
@@ -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
|
||||
|
||||
14
src/plugins/tabs-page-plugin.js
Normal file
14
src/plugins/tabs-page-plugin.js
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user