File tree Expand file tree Collapse file tree 5 files changed +103
-2
lines changed Expand file tree Collapse file tree 5 files changed +103
-2
lines changed Original file line number Diff line number Diff line change 1717 <h2 >Essential Links</h2 >
1818 <nav >
1919 <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 >
2029 <li >
2130 <router-link
2231 to =" /posts/1"
Original file line number Diff line number Diff line change @@ -4,8 +4,10 @@ import VueAnnouncer from '../vue-announcer'
44import App from './App.vue'
55import router from './router.js'
66
7+ import spell from './plugins/announcer/spell'
8+
79Vue . use ( VueHead )
8- Vue . use ( VueAnnouncer , { } , router )
10+ Vue . use ( VueAnnouncer , { plugins : [ spell ] } , router )
911Vue . config . productionTip = false
1012
1113/* 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'
22import Contact from '@/pages/Contact'
33import Home from '@/pages/Home'
44import Post from '@/pages/Post'
5+ import Login from '@/pages/Login'
56import Vue from 'vue'
67import VueRouter from 'vue-router'
78
8-
99Vue . use ( VueRouter )
1010
1111const router = new VueRouter ( {
@@ -21,6 +21,11 @@ const router = new VueRouter({
2121 }
2222 }
2323 } ,
24+ {
25+ name : 'login' ,
26+ path : '/login' ,
27+ component : Login
28+ } ,
2429 {
2530 name : 'about' ,
2631 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