Questions tagged [v-model]

Use this tag for questions related to the v-model directive of Vue.js.

The v-model directive is used to create two-way data bindings on form input, textarea, and select elements. It automatically picks the correct way to update the element based on the input type. Although a bit magical, v-model is essentially syntax sugar for updating data on user input events. For more information: https://vuejs.org/v2/guide/forms.html#Modifiers

420 questions
0
votes
3 answers

Vue,js, Computing a property with v-model?

I have a vue page that loads a bunch of actions from a database. It then creates a table with some data got from the action, using v-for. Here is my problem: In one of the table rows I need a checkbox that is v-modeled to an attribute,…
Brian
  • 385
  • 1
  • 5
  • 23
0
votes
1 answer

Access and modify JSON property using v-model on VUE JS

I generate a JSON with a lot of nested data, one of those properties called 'value' inside 'operations' is used in the v-model of every input of a dynamic generated html table. Initially that property is set to 0 and the input is set with that value…
0
votes
0 answers

The v-model in the view is not updated until after reloading the page for the first time

Because when updating the value of a variable in the method, it is not updated in the v-model of the view ?. If I reload the page the method v-on: change ="reCalcTotal(index, art.stock_solicited)" works correctly, and updates the subtotal value…
0
votes
1 answer

Vue v-model naming best practice

I'm just looking for a bit of best practice advise with the Vue v-model naming convention. I've seen code which just uses a single name like this: export default { data: function () { return { …
Damian
  • 1,652
  • 4
  • 26
  • 44
0
votes
2 answers

v-model doesn't work in the select2 . I didin't know how i can solve. when i remove select2's class v-model works

when user choose some value , i have to hide some input . I can't get value of 'advertisement_type' but i have to get this value. May you help me in this case ? select2 and jquert js later i added vuejs file. when i remove select2 class , v-model…
0
votes
2 answers

vue - textfield bound value not reflecting actual value

I have a simple component that takes a value prop and shows a textfield for editing it. If the number is below zero I want it to just be zero, if the text is deleted out of the textfield I want it to be zero. In my emit event, I can see that I am…
patrickdavey
  • 1,966
  • 2
  • 18
  • 25
0
votes
0 answers

v-on:keyup & v-model not updating data

I'm trying to simply update a variable in data through a v-model on a text input, currently it's throwing no errors, and not updating the variable. The JS is in script tags under the html, not an imported component. Any help would be amazing!…
rargy
  • 109
  • 1
  • 12
0
votes
2 answers

VueJS v-model not working on select tag when bound with dynamic property

I am building an application which will generate a dynamic form for customer feedback reception. Now while adding fields to the form, individual fields have validation rules inlcuding length and type rules, there is also going to be a property on…
Abbas
  • 1,118
  • 1
  • 11
  • 25
0
votes
1 answer

Issue while binding the dynamic form field with v-model

I am trying to prepare a dynamic form that generates a form based on the columns present in the database table. Each form field is based on the columns present in the database table. import { mapGetters } from 'vuex' export default { name:…
Sujan Shrestha
  • 1,020
  • 1
  • 18
  • 32
0
votes
1 answer

Vue input event not capturing entire field

I have a vue component that adds a search bar and search bar functionality. It contains this line: This captures…
Brian
  • 385
  • 1
  • 5
  • 23
0
votes
0 answers

VueJS input with v-model breaks the user input

I have a Vue component with an input with which I used v-model. Theorically it works fine but in practice, it works really bad, if I type too quickly, the input value is broken (for example, typing azertyuiop will result with auip). I can't type…
AymDev
  • 6,626
  • 4
  • 29
  • 52
0
votes
1 answer

change binding created by v-model in vue.js

Stackoverflowers, I'm a newbie of vue.js, I try to implement a binding effect which can enable the changing of binding created by v-model. To put things clear, I give an example as following:
dulq
  • 245
  • 3
  • 11
0
votes
1 answer

Use v-model with groupBy array, return flat array

I'm trying to set up a Vue component that takes a flat list of items in an array, groups them by a property for use in a sub-component, and emits the updated flat array. My section component uses these grouped items in their v-model and emits the…
0
votes
0 answers

How to use v-model with inLine object

i have a custom component with 2 inputs let say date_on and date_off i want to bind that component to current object . note i don't want to use any computed value or function to keep using it on different component without adding extra…
0
votes
1 answer

v-modal with a multi part variable

I'm not sure if this is the correct way to ask this, but I'm having trouble setting up a v-model that has multiple parts. v-model="formInputs.input_ + inputType.id" That would end up being this in the data: data(){ return { formInputs:…
RMH
  • 821
  • 2
  • 15
  • 38