inicios del FrontEnd
This commit is contained in:
28
APP/components/SidebarPlugin/index.js
Executable file
28
APP/components/SidebarPlugin/index.js
Executable file
@@ -0,0 +1,28 @@
|
||||
import Sidebar from './SideBar.vue';
|
||||
import SidebarItem from './SidebarItem.vue';
|
||||
|
||||
const SidebarStore = {
|
||||
showSidebar: false,
|
||||
sidebarLinks: [],
|
||||
displaySidebar(value) {
|
||||
this.showSidebar = value;
|
||||
},
|
||||
};
|
||||
|
||||
const SidebarPlugin = {
|
||||
install(Vue, options) {
|
||||
if (options && options.sidebarLinks) {
|
||||
SidebarStore.sidebarLinks = options.sidebarLinks;
|
||||
}
|
||||
let app = new Vue({
|
||||
data: {
|
||||
sidebarStore: SidebarStore
|
||||
}
|
||||
});
|
||||
Vue.prototype.$sidebar = app.sidebarStore;
|
||||
Vue.component('side-bar', Sidebar);
|
||||
Vue.component('sidebar-item', SidebarItem);
|
||||
}
|
||||
};
|
||||
|
||||
export default SidebarPlugin;
|
||||
Reference in New Issue
Block a user