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 a1eaaf7c
authored
Dec 22, 2020
by
Jonathan Reinink
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update main menu to use url on Inertia page object
1 parent
9d640300
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
12 deletions
resources/js/Shared/Layout.vue
resources/js/Shared/MainMenu.vue
resources/js/Shared/Layout.vue
View file @
a1eaaf7
...
...
@@ -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-800 rounded"
>
<main-menu
:url=
"url()"
/>
<main-menu
/>
</div>
</dropdown>
</div>
...
...
@@ -34,7 +34,7 @@
</div>
</div>
<div
class=
"md:flex md:flex-grow md:overflow-hidden"
>
<main-menu
:url=
"url()"
class=
"hidden md:block bg-indigo-800 flex-shrink-0 w-56 p-12 overflow-y-auto"
/>
<main-menu
class=
"hidden md:block bg-indigo-800 flex-shrink-0 w-56 p-12 overflow-y-auto"
/>
<div
class=
"md:flex-1 px-4 py-8 md:p-12 md:overflow-y-auto"
scroll-region
>
<flash-messages
/>
<slot
/>
...
...
@@ -60,10 +60,5 @@ export default {
Logo
,
MainMenu
,
},
methods
:
{
url
()
{
return
location
.
pathname
.
substr
(
1
)
},
},
}
</
script
>
resources/js/Shared/MainMenu.vue
View file @
a1eaaf7
...
...
@@ -34,16 +34,15 @@ export default {
components
:
{
Icon
,
},
props
:
{
url
:
String
,
},
methods
:
{
isUrl
(...
urls
)
{
let
currentUrl
=
this
.
$page
.
url
.
substr
(
1
)
if
(
urls
[
0
]
===
''
)
{
return
this
.
u
rl
===
''
return
currentU
rl
===
''
}
return
urls
.
filter
(
url
=>
this
.
u
rl
.
startsWith
(
url
)).
length
return
urls
.
filter
(
url
=>
currentU
rl
.
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