You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
704 B
40 lines
704 B
6 years ago
|
import Sidebar from './SideBar.vue'
|
||
|
import SidebarLink from './SidebarLink.vue'
|
||
|
|
||
|
const SidebarStore = {
|
||
|
showSidebar: false,
|
||
|
sidebarLinks: [
|
||
|
{
|
||
|
name: 'Dashboard',
|
||
|
icon: 'ti-panel',
|
||
|
path: '/admin/overview'
|
||
|
}
|
||
|
],
|
||
|
displaySidebar (value) {
|
||
|
this.showSidebar = value
|
||
|
}
|
||
|
}
|
||
|
|
||
|
const SidebarPlugin = {
|
||
|
|
||
|
install (Vue) {
|
||
|
Vue.mixin({
|
||
|
data () {
|
||
|
return {
|
||
|
sidebarStore: SidebarStore
|
||
|
}
|
||
|
}
|
||
|
})
|
||
|
|
||
|
Object.defineProperty(Vue.prototype, '$sidebar', {
|
||
|
get () {
|
||
|
return this.$root.sidebarStore
|
||
|
}
|
||
|
})
|
||
|
Vue.component('side-bar', Sidebar)
|
||
|
Vue.component('sidebar-link', SidebarLink)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export default SidebarPlugin
|