-
카테고리
-
세부 분야
풀스택
-
해결 여부
해결됨
vue3 강의 중에서..... const에다가 ref()를 쓰면은???
21.04.16 17:06 작성 조회수 816
1
아래와 코드에서 const showProfileDropdown = ref(false)이 친구는 값이 바뀌는 친구 인데 const를 쓴 이유가 궁금합니다.
혹시 ref와 연관이 있을까요?
export default {
setup() {
const routes = ref([])
const showProfileDropdown = ref(false)
const currentUser = computed(()=>store.state.user)
onBeforeMount(()=>{
routes.value = router.options.routes
})
const onLogout = async ()=> {
await auth.signOut()
store.commit("SET_USER",null);
await router.replace("/login");
}
return {
routes,
showProfileDropdown,
onLogout,
currentUser,
}
}
}
답변을 작성해보세요.
답변 1