<template>
<div id="app">
<div class="wrapper">
<!-- Sidebar -->
<nav id="sidebar">
<ul class="list-unstyled components">
<b-nav-item :to="{name: 'AdmissionActList'}" v-on:click.prevent="sidebarCollapse">link</b-nav-item>
<b-nav-item :to="{name: 'ShiftsTask'}" v-on:click.prevent="sidebarCollapse">link</b-nav-item>
<b-nav-item :to="{name: 'MaterialTransferActList'}" v-on:click.prevent="sidebarCollapse">link</b-nav-item>
<b-nav-item v-on:click.prevent="sidebarCollapse">Выпуск</b-nav-item>
<b-nav-item :to="{name: 'StorageReportIndex'}" v-on:click.prevent="sidebarCollapse">link</b-nav-item>
<b-nav-item :to="{name: 'ProductionPlanList'}" v-on:click.prevent="sidebarCollapse">link</b-nav-item>
<b-nav-item :to="{name: 'BarcodeCreate'}" v-on:click.prevent="sidebarCollapse">link</b-nav-item>
</ul>
</nav>
</div>
</div>
<template>
<script>
export default {
name: 'App',
data() {
return {
isActive: false,
dropDown:false
}
},
methods: {
sidebarCollapse: function() {
this.isActive = !this.isActive;
},
dropdownCollapse: function() {
this.dropDown = !this.dropDown;
}
},
}
</script>
v-on:click.prevent="sidebarCollapse"
v-for
.links: [
{ title: 'link #1', to: { name: 'AdmissionActList' } },
{ title: 'link #2', to: { name: 'ShiftsTask' } },
// ну и так далее
],
<ul class="list-unstyled components">
<b-nav-item
v-for="link in links"
:to="link.to"
@click.prevent="sidebarCollapse"
>{{ link.title }}</b-nav-item>
</ul>