반응형
vue에서 정확히 언제 다시 발생합니까?
데이터가 변경되면 Vue가 재렌더하는 것으로 알고 있습니다.하지만 후크 기능으로 데이터를 변경할 때처럼mounted
, 페이지는 재인스톨 되지 않습니다.다음은 제 코드의 일부입니다.
mounted: function () {
document.getElementById('lanchange').onclick = function (e) {
this.loginPopActive = false
this.lanPopActive = false
console.log(this.lanPopActive)
}
}
코드에 문제가 있다this
화살표 기능, 클로저 또는bind
.
mounted: function () {
document.getElementById('lanchange').onclick = (e) = >{
this.loginPopActive = false
this.lanPopActive = false
console.log(this.lanPopActive)
}
}
언급URL : https://stackoverflow.com/questions/45031230/when-does-re-render-happen-exactly-in-vue
반응형
'programing' 카테고리의 다른 글
Java Runtime.getRuntime(): 명령줄 프로그램을 실행하여 출력을 가져옵니다. (0) | 2022.06.19 |
---|---|
반환 유형이 있는 Java 메서드(return 스테이트먼트 없이 컴파일) (0) | 2022.06.18 |
Vuex 상태 내에서 맵 사용 (0) | 2022.06.18 |
디렉토리가 존재하는지 확인하려면 어떻게 해야 하나요? (0) | 2022.06.18 |
Linux에서 블루투스/블루투스.h는 어디에 있습니까? (0) | 2022.06.18 |