Template
<textarea v-model="textAreaVal" @focus="changeTextAreaFocus" @blur="changeTextAreaFocus"></textarea>
Script
data() {
return {
placeholder: 'Placeholder..',
textAreaVal: 'Placeholder..',
}
},
methods: {
changeTextAreaFocus() {
if (this.placeholder == this.textAreaVal) {
this. textAreaVal = ''
} else if (this.textAreaVal.length == 0) {
this.textAreaVal = this.placeholder
}
}
}
CSS로 맞출려다가 암걸릴뻔
반응형
'일' 카테고리의 다른 글
NICEAPI 본인확인 PHP 샘플 (1) | 2022.05.12 |
---|---|
민방위 사이버교육 시작하자마자 끝내기 (1) | 2022.04.18 |
Class VCWeakObjectHolder is implemented in both (0) | 2018.07.11 |
Node.js 개발 시작하기 (3) | 2018.03.14 |
2018년 스타트업 기술 스택 이야기 (1) | 2018.03.12 |