Skip to content

Commit

Permalink
画像選択したあとにイベントを発火させよう
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yoshiii committed Jul 20, 2022
1 parent 41bd69d commit 619824c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/components/layouts/SideBar.vue
Expand Up @@ -7,6 +7,7 @@
ref="fileInput"
accept="image/jpeg,image/jpg,image/png"
style="display: none"
@change="updateIcon"
/>
<v-icon dark @click="changeIcon"> mdi-account-circle </v-icon>
</v-avatar>
Expand Down Expand Up @@ -63,9 +64,21 @@ export default {
});
},
changeIcon() {
console.log("changeEvent called");
this.$refs.fileInput.click();
},
updateIcon() {
console.log("update icon run");
const user = this.getAuth();
if (!user) {
sessionStorage.removeItem("user");
this.$router.push("/login");
}
},
getAuth() {
firebase.auth().onAuthStateChanged((user) => {
return user;
});
},
},
};
</script>
Expand Down

0 comments on commit 619824c

Please sign in to comment.