Front End/Vue
vue Study - Refs
YJ_SW
2020. 3. 25. 13:56
728x90
Refs
refs : 템플릿에 접근하여 엘레멘트를 가져온 다음 데이터에 접근?
html에서 input에 넣은 내용(템플릿에 있는) 을 app.js의 Vue instance 로 접근할 수 있다.
this.$refs.input.value 로 입력한 값을 접근 할 수 있다.
< div ref="test">hello</div> 일 때 vue instance 에서 접근 :this.$refs.test.innerText |
-> refs 를 이용해서 페이지에서 요소를 참조하고 그들에 관한 정보를 얻는다
728x90