Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- vue.js
- 애그리거트
- redux
- exiting abnormally
- Express
- react
- 자료구조
- VUE
- $emit()
- rabbitmq 에러
- Java Reflextion API
- 도커빌드
- 공식문서
- 네임드 뷰
- 커스텀 로그인
- paraller
- 리덕스 공식문서
- AWS
- 오라클 병렬처리
- .getClass()
- forNmae()
- 리덕스
- quert
- 오라클
- ACCESS_REFUSED
- 컴포넌트 주도
- 리액트
- EBS
- REDIS
- 자바
Archives
- Today
- Total
개발정리
[트러블 슈팅]-라우터 params undefined 문제 본문
<template>
<div class="box">
<div class="images">
</div>
<hr/>
<div class="profile">
<div class="user">
<div class="photo">
</div>
<div>
</div>
</div>
<div>
</div>
</div>
<hr/>
<div>
</div>
</div>
</template>
<script>
export default{
data(){
return{
item:{},
}
},
mounted(){
//this.item=this.$axios.get(`http://localhost:8080/item/${this.$router.params.id}`);
console.log(this.$router.params);
}
}
</script>
<style scoped>
.photo{
border: 1px solid black;
border-radius: 50%;
width: 50px;
height: 50px;
}
.images{
width: 729px;
height: 502px;
}
.images img{
width: 100%;
height: 100%;
}
.box{
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.user{
display: flex;
}
.profile{
display: flex;
width:729px;
}
</style>
마운트 직후 라우터에서 params를 불러올때 undefined 가 불러지는 문제입니다.
해결
this.$router.currentRoute._value.params 를 사용하면 해결됩니다.
'개발 > 중거거래사이트 클론' 카테고리의 다른 글
[트러블 슈팅] sockJs /info 요청 404 error (0) | 2024.03.03 |
---|---|
[트러블 슈팅] Cannot read properties of undefined (reading 'userId') (0) | 2024.02.23 |
[트러블 슈팅] jpa 양방향 매핑 조회시 stackoverflow 문제 (0) | 2024.02.18 |
[트러블 슈팅] vue.js axios 인터셉터 설정 (0) | 2024.02.16 |
[트러블 슈팅]로그인시 로그아웃으로 변경 (0) | 2024.02.05 |