티스토리 뷰

증상 

input에 검색어를 "구글"이라고 입력을 하면 "구"라는 문자만 전달이 되고 마지막 문자가 짤리는 현상이 있습니다. 

VueJs에서는 이런 경우 input 이벤트를 이용하라고 권고합니다. 

 

For languages that require an IME (Chinese, Japanese, Korean etc.), you’ll notice that v-model doesn’t get updated during IME composition. If you want to cater for these updates as well, use input event instead.

 

https://vuejs.org/v2/guide/forms.html#vmodel-ime-tip

 

수정 전 소스 

<input class="form-control" type="text" name="brandNm" v-model="filter.brandNm" placeholder="브랜드명 검색" @keyup="search()">

수정 후 소스 

<input class="form-control" type="text" name="brandNm" @input="filter.brandNm=$event.target.value" placeholder="브랜드명 검색" @keyUp="search()">

 

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/03   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
글 보관함