반응형
sign.vue
<!--
화면구성
https://vuetifyjs.com/ko/components/menus/
-->
<script>
export default {
data () {
return {
loading: false
}
},
methods: {
<!--
firebase 구글로그인 공식문서
-->
async signInWithGoogle () {
const provider = new this.$firebase.auth.GoogleAuthProvider()
this.$firebase.auth().languageCode = 'ko'
this.loading = true
try {
const sn = await this.$firebase.auth().signInWithPopup(provider)
this.$store.commit('setFireUser', sn.user)
} finally {
this.loading = false
}
},
signOut () {
this.$firebase.auth().signOut()
},
signInWithFacebook () {
throw Error('에러')
}
}
}
</script>
async - await 공부하기
blueshw.github.io/2018/02/27/async-await/
[javascript] async, await를 사용하여 비동기 javascript를 동기식으로 만들자
async, await 는 ES8(ECMAScript2017)의 공식 스펙(링크)으로 비교적 최근에 정의된 문법입니다. 를 사용하면 비동기 코드를 작성할 때 비교적 쉽고 명확하게 코드를 작성할 수 있습니다. 자바스크립트는
blueshw.github.io
반응형
'포트폴리오 만들기 > Vue, firebase 게시판 만들기' 카테고리의 다른 글
관리자 수정모드 (0) | 2020.08.22 |
---|---|
firebase Cloud Functions 활용하기 (0) | 2020.08.17 |
에러 처리하기 (0) | 2020.08.13 |
제목 수정하기 (0) | 2020.08.13 |
firebase realtime database 읽고 쓰기 (0) | 2020.08.13 |