Commit f31d8c2d authored by Amy Yang's avatar Amy Yang

提交代码

parent 945af8e8
...@@ -4,16 +4,25 @@ const routes = { ...@@ -4,16 +4,25 @@ const routes = {
component: { component: {
template: '<router-view></router-view>' template: '<router-view></router-view>'
}, },
meta: {
icon: 'mdi-test-tube'
},
children: [ children: [
{ {
path: 'about', path: 'about',
name: 'About', name: 'About',
component: () => import('@/views/test/About.vue') component: () => import('@/views/test/About.vue'),
meta: {
icon: 'mdi-information-variant'
}
}, },
{ {
path: 'home', path: 'home',
name: 'Home', name: 'Home',
component: () => import('@/views/test/Home.vue') component: () => import('@/views/test/Home.vue'),
meta: {
icon: 'mdi-home'
}
} }
] ]
} }
......
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
dashboards full of beautiful and feature rich modules. dashboards full of beautiful and feature rich modules.
</p> </p>
<p> <p>
<v-btn align="left" color="#2B81D6" class="white--text" outlined>Learn More</v-btn> <v-btn align="left" color="#2B81D6" class="white--text" outlined
>Learn More</v-btn
>
</p> </p>
</div> </div>
<!-- <v-col cols="12" sm="6" md="8" class="info justify-center"> <!-- <v-col cols="12" sm="6" md="8" class="info justify-center">
...@@ -60,13 +62,12 @@ ...@@ -60,13 +62,12 @@
</div> </div>
</v-card-title> </v-card-title>
<v-card-text> <v-card-text>
<form @submit.prevent="submit"> <form>
<v-row> <v-row>
<v-col> <v-col>
<v-text-field <v-text-field
v-model="name" name="username"
:rules="[rules.required]" :rules="[rules.required]"
:error-messages="errors"
label="E-mail" label="E-mail"
outlined outlined
required required
...@@ -78,7 +79,7 @@ ...@@ -78,7 +79,7 @@
<v-text-field <v-text-field
:append-icon="show ? 'mdi-eye' : 'mdi-eye-off'" :append-icon="show ? 'mdi-eye' : 'mdi-eye-off'"
:type="show ? 'text' : 'password'" :type="show ? 'text' : 'password'"
name="input-10-2" name="password"
label="Password" label="Password"
outlined outlined
value value
...@@ -89,8 +90,7 @@ ...@@ -89,8 +90,7 @@
<v-row align="center"> <v-row align="center">
<v-col align="left"> <v-col align="left">
<v-checkbox <v-checkbox
v-model="checkbox" v-model="remember"
:error-messages="errors"
value="1" value="1"
label="Remember me?" label="Remember me?"
type="checkbox" type="checkbox"
...@@ -104,9 +104,11 @@ ...@@ -104,9 +104,11 @@
<v-row> <v-row>
<v-col> <v-col>
<v-btn <v-btn
class="mr-4" class="ma-2"
type="submit" type="submit"
:disabled="invalid" :loading="loading"
:disabled="loading"
@click="loader = 'loading'"
color="primary" color="primary"
block block
>SIGN IN</v-btn >SIGN IN</v-btn
...@@ -130,13 +132,31 @@ ...@@ -130,13 +132,31 @@
export default { export default {
data () { data () {
return { return {
loader: null,
loading: null,
show: false, show: false,
remember: false,
password: 'Password', password: 'Password',
rules: { rules: {
required: value => !!value || 'Required.', required: value => !!value || 'Required.',
emailMatch: () => 'The email and password you entered don\'t match' emailMatch: () => "The email and password you entered don't match"
} }
} }
},
watch: {
loader () {
const l = this.loader
this[l] = !this[l]
setTimeout(() => (this[l] = false), 3000)
this.loader = null
}
},
methods: {
submit () {
}
} }
} }
</script> </script>
...@@ -177,4 +197,40 @@ export default { ...@@ -177,4 +197,40 @@ export default {
} }
} }
} }
.custom-loader {
animation: loader 1s infinite;
display: flex;
}
@-moz-keyframes loader {
from {
transform: rotate(0);
}
to {
transform: rotate(360deg);
}
}
@-webkit-keyframes loader {
from {
transform: rotate(0);
}
to {
transform: rotate(360deg);
}
}
@-o-keyframes loader {
from {
transform: rotate(0);
}
to {
transform: rotate(360deg);
}
}
@keyframes loader {
from {
transform: rotate(0);
}
to {
transform: rotate(360deg);
}
}
</style> </style>
<template> <template>
<v-app id="inspire"> <v-app id="inspire">
<!-- 右侧导航栏 -->
<v-navigation-drawer v-model="drawer" app> <v-navigation-drawer v-model="drawer" app>
<!-- 第五行app去掉后,整个工具栏延伸到左侧导航菜单上方 --> <!-- 第五行app去掉后,整个工具栏延伸到左侧导航菜单上方 -->
<v-list expand dense> <v-list expand dense>
<template v-for="(route, index) in routes"> <template v-for="(route, index) in routes">
<!-- 如果route的children不为空,则组成list-group -->
<template v-if="route.children"> <template v-if="route.children">
<v-list-group :key="index"> <v-list-group :key="index">
<template v-slot:activator> <template v-slot:activator>
<v-list-item-action>
<v-icon>{{ route.meta.icon }}</v-icon>
</v-list-item-action>
<v-list-item-content> <v-list-item-content>
<v-list-item-title v-text="route.name" ripple></v-list-item-title> <v-list-item-title
v-text="route.name"
ripple
></v-list-item-title>
</v-list-item-content> </v-list-item-content>
</template> </template>
<v-list-item <v-list-item
...@@ -16,16 +24,21 @@ ...@@ -16,16 +24,21 @@
:key="idx" :key="idx"
:to="{ name: cRoute.name }" :to="{ name: cRoute.name }"
> >
<v-list-item-action> </v-list-item-action> <v-list-item-action>
<v-icon>{{ cRoute.meta.icon }}</v-icon>
</v-list-item-action>
<v-list-item-content> <v-list-item-content>
<v-list-item-title v-text="cRoute.name"></v-list-item-title> <v-list-item-title v-text="cRoute.name"></v-list-item-title>
</v-list-item-content> </v-list-item-content>
</v-list-item> </v-list-item>
</v-list-group> </v-list-group>
</template> </template>
<!-- 如果route的children为空,则直接已list-item形式展示即可 -->
<template v-else> <template v-else>
<v-list-item :key="index" :to="{ name: route.name }"> <v-list-item :key="index" :to="{ name: route.name }">
<v-list-item-action> </v-list-item-action> <v-list-item-action>
<v-icon>{{ route.meta.icon }}</v-icon>
</v-list-item-action>
<v-list-item-content> <v-list-item-content>
<v-list-item-title v-text="route.name"></v-list-item-title> <v-list-item-title v-text="route.name"></v-list-item-title>
</v-list-item-content> </v-list-item-content>
...@@ -34,16 +47,33 @@ ...@@ -34,16 +47,33 @@
</template> </template>
</v-list> </v-list>
</v-navigation-drawer> </v-navigation-drawer>
<!-- 顶部工具栏-->
<v-app-bar app> <v-app-bar app>
<v-app-bar-nav-icon @click.stop="drawer = !drawer"></v-app-bar-nav-icon> <v-app-bar-nav-icon @click.stop="drawer = !drawer"></v-app-bar-nav-icon>
<v-toolbar-title>Application</v-toolbar-title> <v-toolbar-title>Application</v-toolbar-title>
<v-spacer></v-spacer>
<v-menu offset-y>
<template v-slot:activator="{ attrs, on }">
<v-btn v-bind="attrs" v-on="on" plain>
username
<v-icon>
mdi-menu-down
</v-icon>
</v-btn>
</template>
<v-list>
<v-list-item v-for="item in items" :key="item" link>
<v-list-item-title v-text="item"></v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
</v-app-bar> </v-app-bar>
<v-main> <v-main>
<router-view /> <router-view />
</v-main> </v-main>
<!-- 页面底部部分 -->
<v-footer app> <v-footer app>
<v-spacer></v-spacer>
<span class="black--text">&copy; {{ new Date().getFullYear() }}</span> <span class="black--text">&copy; {{ new Date().getFullYear() }}</span>
</v-footer> </v-footer>
</v-app> </v-app>
...@@ -53,7 +83,8 @@ ...@@ -53,7 +83,8 @@
export default { export default {
data () { data () {
return { return {
drawer: null drawer: null,
items: ['reset password', 'quit']
} }
}, },
computed: { computed: {
......
...@@ -11,7 +11,7 @@ export default { ...@@ -11,7 +11,7 @@ export default {
} }
}, },
beforeCreate () { beforeCreate () {
console.log(this.$router) console.log(this.$route)
} }
} }
</script> </script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment