@rrc-materials/core
Version:
rrc materials for core
40 lines (31 loc) • 957 B
JavaScript
import './index.scss'
import Element, { Notification, Loading } from 'element-ui'
import locale from 'element-ui/lib/locale/lang/zh-CN'
import RouterConfig from './router/router.config'
const DEFAULT_OPTIONS = {
/**
* 在路由之后去 隐藏loading
*/
noAfterRouteIsLoading: [],
// 移除掉 tabs 添加状态的 hash 值 解决tab 重复添加的bug
removeTabHash: false
}
const install = (Vue, { router, store, options }) => {
const config = Object.assign({}, DEFAULT_OPTIONS, options || {})
if (install.installed) {
return
}
install.installed = true
Vue.use(Element, { locale })
window.rrc = Object.create(null)
window.rrc.$notify = Notification
window.rrc.$loading = Loading.service
if (!router) {
console.error('@rrc-materials/layout need options: router') // eslint-disable-line
return
}
RouterConfig(router, store, config)
}
export default {
install
}