[vue] 조건으로 버튼 활성화 막기 (v-bind:disabled)

박민규·2021년 9월 8일
0

vue

목록 보기
6/10

텍스트의 값이 비어있을 경우 클릭 버튼이 활성화 x

<button type="button" v-bind:disabled="textValue == ''">클릭</button>

숫자가 0이면 - 클릭 버튼이 활성화 x

<button type="button" v-on:click="decreaseCounter" v-bind:disabled="counter == 0">Add (- 1)</button>

v-on:click="decreaseCounter" 대신에 @click="decreaseCounter" 이렇게 써도됨

profile
개(발)초보

0개의 댓글