ref로 접근하기
ref 값은 this.$refs에 노출됩니다
<script>
export default {
mounted() {
this.$refs.input.focus()
}
}
</script>
<template>
<input ref="input" />
</template>
컴포넌트가 마운트된 후에만 ref에 접근할 수 있습니다.
$refs.input이 템플릿 표현식에 있으면 첫 렌더링 시 null입니다.
이는 첫 렌더링이 끝날 때까지 엘리먼트가 존재하지 않기 때문입니다!
[VUE] 컴포넌트를 tr 또는 li로 넣을 때
<table>
<tr is="vue:blog-post-row"></tr>
//이렇게 is="vue:컴포넌트명"
</table>
이렇게 넣어야함