Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
WebKuliner2021
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tiarro Elprida Tamba
WebKuliner2021
Commits
afb1c9b8
Commit
afb1c9b8
authored
Feb 27, 2021
by
Tiarro Elprida Tamba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
c7ec164a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
0 deletions
+61
-0
Navbar.vue
WebKuliner/src/components/Navbar.vue
+61
-0
No files found.
WebKuliner/src/components/Navbar.vue
0 → 100644
View file @
afb1c9b8
<
template
>
<div>
<b-navbar
toggleable=
"lg"
type=
"light"
>
<div
class=
"container"
>
<b-navbar-brand
href=
"#"
>
Kulineran
</b-navbar-brand>
<b-navbar-toggle
target=
"nav-collapse"
></b-navbar-toggle>
<b-collapse
id=
"nav-collapse"
is-nav
>
<b-navbar-nav>
<li
class=
"nav-item"
>
<router-link
class=
"nav-link"
to=
"/"
>
Home
</router-link>
</li>
<li
class=
"nav-item"
>
<router-link
class=
"nav-link"
to=
"/foods"
>
Foods
</router-link>
</li>
</b-navbar-nav>
<!-- Right aligned nav items -->
<b-navbar-nav
class=
"ml-auto"
>
<li
class=
"nav-item"
>
<router-link
class=
"nav-link"
to=
"/keranjang"
>
Keranjang
<b-icon-bag></b-icon-bag>
<span
class=
"badge badge-success ml-2"
>
{{
updateKeranjang
?
updateKeranjang
.
length
:
jumlah_pesanans
.
length
}}
</span>
</router-link>
</li>
</b-navbar-nav>
</b-collapse>
</div>
</b-navbar>
</div>
</
template
>
<
script
>
import
axios
from
"axios"
;
export
default
{
name
:
"Navbar"
,
data
()
{
return
{
jumlah_pesanans
:
[],
};
},
props
:
[
"updateKeranjang"
],
methods
:
{
setJumlah
(
data
)
{
this
.
jumlah_pesanans
=
data
;
},
},
mounted
()
{
axios
.
get
(
"http://localhost:3000/keranjangs"
)
.
then
((
response
)
=>
this
.
setJumlah
(
response
.
data
))
.
catch
((
error
)
=>
console
.
log
(
error
));
},
};
</
script
>
<
style
></
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment