부동산 쇼핑몰에서
값이 0이 되면 discount를 사라지게 하고 싶은데
해당코드 작성했을 씨. 사라지지 않습니다. ㅠㅠㅠ
코드 문제점 확인 부탁드리겠습니다 ㅠㅠ
<template>
<Discount v-if="showDiscount=true" :amount="amount"/>
</template>
<script>
import oneroomData from './assets/oneroom.js'
//import {변수명1, 변수명2} from './assets/oneroom.js'
import Discount from '../src/components/discount.vue'
import Modal from '../src/components/Modal.vue'
import Card from '../src/components/Card.vue'
export default {
name: 'App',
components: {
Discount,
Modal,
Card
},
data (){
return{
amount: 30,
showDiscount : true,
원룸들오리지널 : [...oneroomData],
누른거 : 0,
원룸들 : oneroomData,
모달창열렸니 : false,
신고수: [0,0,0],
price: [60,70,80],
products : ['역삼동원룸', '천호동원룸', '마포구원룸'],
메뉴들 : ['Home', 'Show','About']
}
},
methods : {
increase (){
this.신고수 +=1;
},
priceSort(){
this.원룸들.sort(function(a,b){
return a.price - b.price
})
},
sortBack(){
this.원룸들 = [...this.원룸들오리지널];
}
},
created(){
},
mounted(){
setInterval(()=>{
this.amount --
// console.log(this)
if(this.amount === 0){
this.showDiscount =false;
}
},1000);
//clear interval
}
}
</script>