Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | 1x 1x | <template> <div class="menu h-100"> <ul class="d-flex flex-column h-100 pt-3 p-0 pr-2"> <li v-on:click="setPage()" class="menu-item cursor-pointer d-flex align-items-center" :class="currentPage === '' && 'active'" > <span class="d-flex align-items-center w-100 p-1" ><BIconHouseDoorFill class="mr-2" />Home</span > </li> <li v-on:click="setPage('orders')" class="menu-item cursor-pointer d-flex align-items-center" :class="currentPage === 'orders' && 'active'" > <span class="d-flex align-items-center w-100 p-1" ><BIconInboxFill class="mr-2" />Orders</span > </li> <li v-on:click="setPage('products')" class="menu-item cursor-pointer d-flex align-items-center" :class="currentPage === 'products' && 'active'" > <span class="d-flex cursor-pointer align-items-center w-100 p-1" ><BIconTagFill class="mr-2" />Products</span > </li> <li v-on:click="setPage('bundles')" class="menu-item cursor-pointer d-flex align-items-center" :class="currentPage === 'bundles' && 'active'" > <span class="d-flex align-items-center w-100 p-1" ><BIconTagsFill class="mr-2" />Bundles</span > </li> <li v-on:click="setPage('customers')" class="menu-item cursor-pointer d-flex align-items-center" :class="currentPage === 'customers' && 'active'" > <span class="d-flex align-items-center w-100 p-1" ><BIconPersonFill class="mr-2" />Customers</span > </li> <li v-on:click="setPage('categories')" class="menu-item cursor-pointer d-flex align-items-center" :class="currentPage === 'categories' && 'active'" > <span class="d-flex align-items-center w-100 p-1" ><BIconStack class="mr-2" />Categories</span > </li> <li v-on:click="setPage('types')" class="menu-item cursor-pointer d-flex align-items-center" :class="currentPage === 'types' && 'active'" > <span class="d-flex align-items-center w-100 p-1" ><BIconClipboard class="mr-2" />Types</span > </li> <li v-on:click="setPage('articles')" class="menu-item cursor-pointer d-flex align-items-center" :class="currentPage === 'articles' && 'active'" > <span class="d-flex align-items-center w-100 p-1" ><BIconJournalText class="mr-2" />Articles</span > </li> </ul> </div> </template> <script> export default { name: "AdminMenu", data: () => ({ currentPage: "" }), methods: { setPage: function (page = "") { this.$emit("isOpen", false); this.currentPage = page; this.$router.push(`/admin/${page}`); }, popstate: function () { this.currentPage = window.location.pathname.replace("/admin/", ""); }, }, beforeMount() { this.popstate(); }, mounted() { window.addEventListener("popstate", this.popstate); }, destroyed() { window.removeEventListener("popstate", this.popstate); }, }; </script> <style scoped> @media (max-width: 768px) { .menu { background-color: #fff; } } span { font-size: 1rem; } .menu { z-index: 20; color: #000; border-right: 1px solid black; } .menu-item::before { content: ""; width: 4px; height: 100%; display: block; margin-right: 4px; } .menu-item.active::before { content: ""; background-color: green; border-radius: 0 5px 5px 0; } .menu-item.active > span { background-color: #edeef0; border-radius: 5px; color: green; } </style> |