Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
V
vue-demo
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Amy Yang
vue-demo
Commits
f31d8c2d
Commit
f31d8c2d
authored
Jan 28, 2021
by
Amy Yang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
945af8e8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
115 additions
and
19 deletions
+115
-19
test.js
vue-demo/src/router/modules/test.js
+11
-2
Login.vue
vue-demo/src/views/auth/Login.vue
+66
-10
AppLayout.vue
vue-demo/src/views/layouts/AppLayout.vue
+37
-6
About.vue
vue-demo/src/views/test/About.vue
+1
-1
No files found.
vue-demo/src/router/modules/test.js
View file @
f31d8c2d
...
@@ -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'
}
}
}
]
]
}
}
...
...
vue-demo/src/views/auth/Login.vue
View file @
f31d8c2d
...
@@ -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=
"user
name"
: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=
"m
r-4
"
class=
"m
a-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,12 +132,30 @@
...
@@ -130,12 +132,30 @@
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
()
{
}
}
}
}
}
}
...
@@ -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
>
vue-demo/src/views/layouts/AppLayout.vue
View file @
f31d8c2d
<
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"
>
©
{{ new Date().getFullYear() }}
</span>
<span
class=
"black--text"
>
©
{{ 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
:
{
...
...
vue-demo/src/views/test/About.vue
View file @
f31d8c2d
...
@@ -11,7 +11,7 @@ export default {
...
@@ -11,7 +11,7 @@ export default {
}
}
},
},
beforeCreate
()
{
beforeCreate
()
{
console
.
log
(
this
.
$route
r
)
console
.
log
(
this
.
$route
)
}
}
}
}
</
script
>
</
script
>
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