浏览代码

Navbar(login + register) vue 생성 > fixed-toolbar

yongun 5 年之前
父节点
当前提交
df3e4c2618
共有 3 个文件被更改,包括 26 次插入1 次删除
  1. 20 1
      pages/index.vue
  2. 3 0
      pages/login/index.vue
  3. 3 0
      pages/register/index.vue

+ 20 - 1
pages/index.vue

@@ -1,5 +1,18 @@
 <template>
-  <div class="md-layout md-aligment-center">
+  <div class="md-layout md-aligment-center" style="margin: 4em 0">
+    <!-- TOP Navigation-->
+    <md-toolbar class="fixed-toolbar" elevation="1">
+      <md-button class="md-icon-button">
+        <md-icon>menu</md-icon>
+      </md-button>
+      <nuxt-link class="md-primary md-title" to="/">
+        NuxtNews
+      </nuxt-link>
+      <div class="md-toolbar-section-end">
+        <md-button to="/login">Login</md-button>
+        <md-button to="/register">Register</md-button>
+      </div>
+    </md-toolbar>
     <!-- App Content -->
     <div class="md-layout-item md-size-95">
       <md-content class="md-layout md-gutter" style="background: #007998; padding: 1em;">
@@ -66,4 +79,10 @@ export default {
   .small-icon {
     font-size: 18px !important;
   }
+
+  .fixed-toolbar {
+    position: fixed;
+    top: 0;
+    z-index: 5;
+  }
 </style>

+ 3 - 0
pages/login/index.vue

@@ -0,0 +1,3 @@
+<template>
+  <p>login</p>
+</template>

+ 3 - 0
pages/register/index.vue

@@ -0,0 +1,3 @@
+<template>
+  <p>register</p>
+</template>