From 3a25b67de025b4a5785fc6aa4b745bdd21c827a0 Mon Sep 17 00:00:00 2001 From: Jack Goh Date: Wed, 29 Aug 2018 10:34:30 +0800 Subject: [PATCH] refactor navbar code --- resources/assets/js/components/Navbar.vue | 414 +++++++++++++--------- 1 file changed, 250 insertions(+), 164 deletions(-) diff --git a/resources/assets/js/components/Navbar.vue b/resources/assets/js/components/Navbar.vue index 04464016..03ecc9ee 100644 --- a/resources/assets/js/components/Navbar.vue +++ b/resources/assets/js/components/Navbar.vue @@ -1,93 +1,191 @@ - + < + div class = "dropdown-divider" / > + < + a href = "#" +class = "dropdown-item pl-3" +@click.prevent = "logout" > + < + fa icon = "sign-out-alt" +fixed - width / > { + { + $t('logout') + } + } < + /a> < + /div> < + /li> < + /template> + + < + template v - + else > + < + li class = "nav-item" > + < + router - link: to = "{ name: 'login' }" +class = "nav-link" +active - class = "active" > { + { + $t('login') + } + } < + /router-link> < + /li> < + li class = "nav-item" > + < + router - link: to = "{ name: 'register' }" +class = "nav-link" +active - class = "active" > { + { + $t('register') + } + } < + /router-link> < + /li> < + /template> < + /ul> < + /div> < + /div> < + /nav> < + /template> - +} < +/script> - + } + .item { + margin - top: 10 px; + margin - right: 40 px; + } < + /style> \ No newline at end of file