db.collection('product').doc(쿼리스트링.get('id')).get().then((result)=>{
console.log(result.data())
$('.title').html(result.data().제목)
$('.price').html(result.data().가격)
$('.detail-pic').css('background-image', 'url(${result.data().이미지})' )
})
이렇게 썼는데 다른것은 다 나오나 이미지가 업로드 되지 않습니다.
db.collection('product').doc(쿼리스트링.get('id')).get().then((result)=>{
console.log(result.data())
var 템플릿 = ` <div class="container">
상세페이지임
<div class="detail-pic my-4" style="background-image: url(${result.data().이미지});"></div>
<div>
<h5 class="title">${result.data().제목}</h5>
<p class="date">${result.data().날짜}</p>
<hr>
<p class="price">내용 : ${result.data().내용}</p>
<p class="price">${result.data().가격}원</p>
<h5>올린사람 : ${JSON.parse(localStorage.getItem('user')).displayName}</h5>
<button type="submit" class="btn btn-primary" id="edit">수정</button>
</div>
</div>`;
$('.container').append(템플릿)
이렇게 index를 짤때와 같은 방식으로 템플릿에 넣었는데 이미지가 나오긴 하나 뒤에 강의 따라가려니 문제가 생기는거 같아서요 ㅠㅠ
그래서 제가
db.collection('product').doc(쿼리스트링.get('id')).get().then((result)=>{
console.log(result.data())
$('.title').html(result.data().제목)
$('.price').html(result.data().가격)
$('.detail-pic').css('background-image', 'url(${result.data().이미지})' )
})
이 코드에서 왜 이미지가 업로드 안되는건가요??