File tree 6 files changed +77
-74
lines changed
6 files changed +77
-74
lines changed Original file line number Diff line number Diff line change 8
8
"lint" : " vue-cli-service lint"
9
9
},
10
10
"dependencies" : {
11
- "@ionic/vue" : " 0.0.4 " ,
11
+ "@ionic/vue" : " 0.0.9 " ,
12
12
"ionic" : " 5.0.2" ,
13
13
"vue" : " ^2.5.22" ,
14
14
"vue-router" : " 3.0.6" ,
Original file line number Diff line number Diff line change 5
5
< meta http-equiv ="X-UA-Compatible " content ="IE=edge " />
6
6
< meta name ="viewport " content ="width=device-width,initial-scale=1.0 " />
7
7
< link rel ="icon " href ="<%= BASE_URL %>favicon.ico " />
8
- <!-- <link
9
- href="https://unpkg.com/@ionic/core@4.4.2/css/ionic.bundle.css"
10
- rel="stylesheet"
11
- />
12
- <script src="https://unpkg.com/@ionic/core@4.4.2/dist/ionic.js"></script> -->
13
8
14
9
< title > Ionic View SideMenu</ title >
15
10
</ head >
Original file line number Diff line number Diff line change @@ -20,9 +20,9 @@ console.log(window.Ionic);
20
20
21
21
const privateRoute = ( to , from , next ) => {
22
22
let userStore = store . state . user ;
23
- let isAuthenticated = userStore !== null ;
24
-
23
+ let isAuthenticated = userStore . user !== null ;
25
24
console . log ( "isAuthenticated:" + isAuthenticated ) ;
25
+
26
26
if ( ! isAuthenticated ) {
27
27
next ( { name : "login" } ) ;
28
28
} else {
Original file line number Diff line number Diff line change 28
28
<ion-label >Mushrooms</ion-label >
29
29
<ion-checkbox slot =" end" value =" mushrooms" />
30
30
</ion-item >
31
+
32
+ <ion-item >
33
+ <ion-label >on-input-vue test</ion-label >
34
+ <ion-input-vue type =" text" id =" theOne" v-model =" user.custom" required =true maxlength =" 2" > </ion-input-vue >
35
+ </ion-item >
36
+
31
37
</ion-list >
32
38
<ion-button @click =" $router.push('/about/help')" >Help</ion-button >
33
39
</ion-content >
36
42
37
43
<script >
38
44
export default {
39
- name: " about"
40
- };
45
+ name: " about" ,
46
+ data () {
47
+ return {
48
+ user: { custom: " " }
49
+ };
50
+ }
51
+ }
41
52
</script >
53
+ <style scoped>
54
+ ion-input #theOne :invalid {
55
+ background-color : red !important ;
56
+ }
57
+
58
+ </style >
Original file line number Diff line number Diff line change 15
15
<ion-content padding >
16
16
<form >
17
17
<ion-label position =" stacked" >Email</ion-label >
18
- <ion-input @ionChange = " (_event)=> email = _event.detail.value " type = " text " ></ion-input >
18
+ <ion-input-vue type = " text " v-model = " email " ></ion-input-vue >
19
19
<ion-label position =" stacked" >Password</ion-label >
20
- <ion-input @ionChange = " (_event)=> password = _event.detail.value " type =" password" ></ion-input >
20
+ <ion-input-vue type = " password" v-model =" password" ></ion-input-vue >
21
21
<ion-button @click =" doLogin()" >Login</ion-button >
22
22
</form >
23
23
</ion-content >
@@ -29,12 +29,14 @@ export default {
29
29
name: " Login" ,
30
30
methods: {
31
31
async doLogin () {
32
- await this .$store .dispatch (" user/login" , {
32
+ let result = await this .$store .dispatch (" user/login" , {
33
33
email: this .email ,
34
34
password: this .password
35
35
});
36
- console .log (this .$store .state );
37
- this .$router .push (" /" );
36
+ if (true ) {
37
+ console .log (this .$store .state );
38
+ this .$router .push (" /" );
39
+ }
38
40
}
39
41
},
40
42
data () {
@@ -46,7 +48,7 @@ data() {
46
48
mounted () {
47
49
console .log (" mounted" );
48
50
const menuCtrl = document .querySelector (" ion-menu-controller" );
49
- menuCtrl .enable (false );
51
+ // menuCtrl.enable(false);
50
52
}
51
53
};
52
54
</script >
You can’t perform that action at this time.
0 commit comments