Skip to content

Commit a4eb8a8

Browse files
update & cleanup
1 parent 2594aed commit a4eb8a8

File tree

6 files changed

+77
-74
lines changed

6 files changed

+77
-74
lines changed

package-lock.json

+47-58
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"lint": "vue-cli-service lint"
99
},
1010
"dependencies": {
11-
"@ionic/vue": "0.0.4",
11+
"@ionic/vue": "0.0.9",
1212
"ionic": "5.0.2",
1313
"vue": "^2.5.22",
1414
"vue-router": "3.0.6",

public/index.html

-5
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@
55
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
66
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
77
<link rel="icon" href="<%= BASE_URL %>favicon.ico" />
8-
<!-- <link
9-
href="https://unpkg.com/@ionic/[email protected]/css/ionic.bundle.css"
10-
rel="stylesheet"
11-
/>
12-
<script src="https://unpkg.com/@ionic/[email protected]/dist/ionic.js"></script> -->
138

149
<title>Ionic View SideMenu</title>
1510
</head>

src/main.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ console.log(window.Ionic);
2020

2121
const privateRoute = (to, from, next) => {
2222
let userStore = store.state.user;
23-
let isAuthenticated = userStore !== null;
24-
23+
let isAuthenticated = userStore.user !== null;
2524
console.log("isAuthenticated:" + isAuthenticated);
25+
2626
if (!isAuthenticated) {
2727
next({ name: "login" });
2828
} else {

src/views/About.vue

+19-2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@
2828
<ion-label>Mushrooms</ion-label>
2929
<ion-checkbox slot="end" value="mushrooms"/>
3030
</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+
3137
</ion-list>
3238
<ion-button @click="$router.push('/about/help')">Help</ion-button>
3339
</ion-content>
@@ -36,6 +42,17 @@
3642

3743
<script>
3844
export default {
39-
name: "about"
40-
};
45+
name: "about",
46+
data() {
47+
return {
48+
user: { custom: "" }
49+
};
50+
}
51+
}
4152
</script>
53+
<style scoped>
54+
ion-input#theOne :invalid {
55+
background-color: red !important;
56+
}
57+
58+
</style>

src/views/Login.vue

+8-6
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
<ion-content padding>
1616
<form>
1717
<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>
1919
<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>
2121
<ion-button @click="doLogin()">Login</ion-button>
2222
</form>
2323
</ion-content>
@@ -29,12 +29,14 @@ export default {
2929
name: "Login",
3030
methods: {
3131
async doLogin() {
32-
await this.$store.dispatch("user/login", {
32+
let result = await this.$store.dispatch("user/login", {
3333
email: this.email,
3434
password: this.password
3535
});
36-
console.log(this.$store.state);
37-
this.$router.push("/");
36+
if (true) {
37+
console.log(this.$store.state);
38+
this.$router.push("/");
39+
}
3840
}
3941
},
4042
data() {
@@ -46,7 +48,7 @@ data() {
4648
mounted() {
4749
console.log("mounted");
4850
const menuCtrl = document.querySelector("ion-menu-controller");
49-
menuCtrl.enable(false);
51+
// menuCtrl.enable(false);
5052
}
5153
};
5254
</script>

0 commit comments

Comments
 (0)