Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Письменов Дмитрий Иванович
/
yourroomads
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 1d215f22
authored
Sep 28, 2019
by
Jonathan Reinink
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make main menu reactive
1 parent
e3e57b47
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
resources/js/Shared/Layout.vue
resources/js/Shared/MainMenu.vue
resources/js/Shared/Layout.vue
View file @
1d215f2
...
...
@@ -11,7 +11,7 @@
<dropdown
class=
"md:hidden"
placement=
"bottom-end"
>
<svg
class=
"fill-white w-6 h-6"
xmlns=
"http://www.w3.org/2000/svg"
viewBox=
"0 0 20 20"
><path
d=
"M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z"
/></svg>
<div
slot=
"dropdown"
class=
"mt-2 px-8 py-4 shadow-lg bg-indigo-darker rounded"
>
<main-menu
/>
<main-menu
:url=
"url()"
/>
</div>
</dropdown>
</div>
...
...
@@ -34,7 +34,7 @@
</div>
</div>
<div
class=
"flex flex-grow overflow-hidden"
>
<main-menu
class=
"bg-indigo-darker flex-no-shrink w-56 p-12 hidden md:block overflow-y-auto"
/>
<main-menu
:url=
"url()"
class=
"bg-indigo-darker flex-no-shrink w-56 p-12 hidden md:block overflow-y-auto"
/>
<div
class=
"w-full overflow-hidden px-4 py-8 md:p-12 overflow-y-auto"
scroll-region
>
<flash-messages
/>
<slot
/>
...
...
@@ -67,6 +67,9 @@ export default {
}
},
methods
:
{
url
()
{
return
location
.
pathname
.
substr
(
1
)
},
hideDropdownMenus
()
{
this
.
showUserMenu
=
false
},
...
...
resources/js/Shared/MainMenu.vue
View file @
1d215f2
...
...
@@ -34,13 +34,16 @@ export default {
components
:
{
Icon
,
},
props
:
{
url
:
String
,
},
methods
:
{
isUrl
(...
urls
)
{
if
(
urls
[
0
]
===
''
)
{
return
location
.
pathname
.
substr
(
1
)
===
''
return
this
.
url
===
''
}
return
urls
.
filter
(
url
=>
location
.
pathname
.
substr
(
1
)
.
startsWith
(
url
)).
length
return
urls
.
filter
(
url
=>
this
.
url
.
startsWith
(
url
)).
length
},
},
}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment