v-text-field 양수만 입력하는법

2023. 2. 17. 18:01Vue

<v-text-field
   type="number"
   oninput="if(this.value < 0) this.value = 0;"
></v-text-field

 

 

 

 

 

oninput="if(this.value < 0) this.value = 0;"를 v-text-field에 넣는다.

 

value가 0보다 작으면 0으로 설정하게 하는 것이다.

 

 

참고한 링크

 

https://stackoverflow.com/questions/62932508/how-can-i-set-my-v-text-field-to-not-show-negative-numbers