목록전체 글 (185)
Mi Lugarcito
setInterval 예제1 const token_check_time = 60000 if (this.$user.isLogin === true){ this.$tokenAxios.get('/user/getUserInfo') setInterval(()=>{ this.$tokenAxios.get('/user/getUserInfo') }, token_check_time) } this.passwordAuthProc = setInterval(()=>{ console.log("interval"); function numberFill(number){ return ("0"+number).substr(-2,2); } this.passwordAuthTime.date = new Date(this.passwordAuthTime...
Computed 예시 참조하고 있는 값이 변경될때마다 정의한 계산식에 따라 값을 출력함 이전 {{ pageNum + 1 }} / {{ pageCount || 0 }} 다음 computed:{ pageCount () { let listLeng = this.user_data.product_list.length, listSize = this.pageSize, page = Math.floor(listLeng / listSize); if (listLeng % listSize > 0) { page += 1; return page; } }, } Watch 예시 지정한 대상의 값이 변경될때마다 정의한 함수가 실행된다. data(){ return{ modal_state: { // 모달 상태 point: false, po..