murilo's avatar
Level 10

Vue is not setting max value input dynamic

Hello guys , I have a Input like this one -

 <input min=1 max=4 v-model.number="qty" type="number" >

It is setting the min value and the max value . ti is working but . If I try to make the max value dynamic like this one -

<input min=1 max=max_qty v-model.number="qty" type="number" >

It will not work , I tryed as well like this -

<input min=1 max="max_qty" v-model.number="qty" type="number" >
<input min=1 max="parseInt(max_qty)" v-model.number="qty" type="number" >

The code is here -

http://jsbin.com/genivag/edit?html,css,js,console,output

Thanks

0 likes
3 replies
ziaakbari's avatar

hi dear, I have the same problem, this solution is not working

my input is

  <md-field>
          <md-input type="date" v-model="selectedDate" required  :min="minDate"></md-input>
   </md-field>

and variable binded

  data: () => ({
    minDate: '2020-09-06',
  }),

could you help me please

SirG's avatar

When binding elements, make sure that there is no type conversion, the value on that min and max attribute might be returning a string if it's in quotes

Please or to participate in this conversation.