File tree 5 files changed +103
-2
lines changed
5 files changed +103
-2
lines changed Original file line number Diff line number Diff line change 17
17
<h2 >Essential Links</h2 >
18
18
<nav >
19
19
<ul >
20
+ <li >
21
+ <router-link
22
+ to =" login"
23
+ title =" Go to example login page"
24
+ aria-label =" Go to example login page"
25
+ >
26
+ Login
27
+ </router-link >
28
+ </li >
20
29
<li >
21
30
<router-link
22
31
to =" /posts/1"
Original file line number Diff line number Diff line change @@ -4,8 +4,10 @@ import VueAnnouncer from '../vue-announcer'
4
4
import App from './App.vue'
5
5
import router from './router.js'
6
6
7
+ import spell from './plugins/announcer/spell'
8
+
7
9
Vue . use ( VueHead )
8
- Vue . use ( VueAnnouncer , { } , router )
10
+ Vue . use ( VueAnnouncer , { plugins : [ spell ] } , router )
9
11
Vue . config . productionTip = false
10
12
11
13
/* eslint-disable no-new */
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div class =" login-container" >
3
+ <h2 >Login Page</h2 >
4
+
5
+ <form
6
+ id =" form-login"
7
+ name =" form-login"
8
+ >
9
+ <div >
10
+ <label for =" email" >
11
+ <span style =" display : block ;text-align :left ;" >Email</span >
12
+ <input
13
+ id =" email"
14
+ v-model =" email"
15
+ name =" email"
16
+ type =" email"
17
+ >
18
+ </label >
19
+ </div >
20
+ <div >
21
+ <label for =" password" >
22
+ <span style =" display : block ;text-align :left ;" >Password</span >
23
+ <input
24
+ id =" password"
25
+ v-model =" password"
26
+ name =" password"
27
+ type =" password"
28
+ >
29
+ </label >
30
+ <button
31
+ type =" button"
32
+ @click =" $announcer.plugins.spell(password)"
33
+ >
34
+ Spell the password
35
+ </button >
36
+ </div >
37
+ </form >
38
+ </div >
39
+ </template >
40
+
41
+ <script >
42
+ export default {
43
+ name: ' Login' ,
44
+
45
+ data : () => ({
46
+ email: null ,
47
+ password: null ,
48
+ spelling: false
49
+ }),
50
+
51
+ watch: {
52
+ password (val ) {
53
+ if (this .spelling ) this .$announcer .assertive (val .substr (- 1 , 1 ))
54
+ }
55
+ }
56
+ }
57
+ </script >
58
+
59
+ <style >
60
+ .login-container {
61
+ max-width : 400px ;
62
+ margin : 0 auto ;
63
+ }
64
+
65
+ #form-login > div {
66
+ margin-bottom : 20px ;
67
+ }
68
+
69
+ #form-login label > span {
70
+ display : block ;
71
+ text-align :left ;
72
+ margin-bottom : 6px ;
73
+ }
74
+
75
+ #form-login input {
76
+ width : 100% ;
77
+ padding : 10px ;
78
+ }
79
+
80
+ #form-login button {
81
+ padding : 4px ;
82
+ margin-top : 10px ;
83
+ }
84
+ </style >
Original file line number Diff line number Diff line change @@ -2,10 +2,10 @@ import About from '@/pages/About'
2
2
import Contact from '@/pages/Contact'
3
3
import Home from '@/pages/Home'
4
4
import Post from '@/pages/Post'
5
+ import Login from '@/pages/Login'
5
6
import Vue from 'vue'
6
7
import VueRouter from 'vue-router'
7
8
8
-
9
9
Vue . use ( VueRouter )
10
10
11
11
const router = new VueRouter ( {
@@ -21,6 +21,11 @@ const router = new VueRouter({
21
21
}
22
22
}
23
23
} ,
24
+ {
25
+ name : 'login' ,
26
+ path : '/login' ,
27
+ component : Login
28
+ } ,
24
29
{
25
30
name : 'about' ,
26
31
path : '/about' ,
Original file line number Diff line number Diff line change
1
+ $contentMaxWidth = 960px
You can’t perform that action at this time.
0 commit comments