사용하고 있는 Layout 의 파일에서 아래와 같이 수정한다.
<template>
<nuxt :nuxtChildKey="routerViewKey"/>
</template>
<script>
export default {
computed: {
routerViewKey () {
// If current route has children
if (this.$route.matched.length > 1) {
return compile(this.$route.matched[0].path)(this.$route.params)
}
return this.$route.fullPath.split('?')[0].split('#')[0]
}
},
}
</script>
간단히 설명하자면, 동적 route를 사용하더라도 nuxt-child 에 key를 부여하여 트랜지션이 작동하도록 하는것이다.
참조 : https://github.com/nuxt/nuxt.js/issues/1651#issuecomment-340193233
'개발 > Vue.js' 카테고리의 다른 글
| SPA(Vue.js, Angular, React) 소셜로그인 흐름도 (1) | 2018.11.06 |
|---|---|
| Vue.js 에서 컴포넌트 내 method에서 data에 접근할 수 없는 문제 발생 (0) | 2018.11.06 |