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
1 answer

How to fix binding issue in Vue js

{{project.name}} - {{project.client.name}}
ExpertWeblancer
  • 1,368
  • 1
  • 13
  • 28
0
votes
0 answers

Vue-JS Displaying other data than the v-model in an input

Here's part of my code: data() { return { dossier: [{ caisse: '', // I change this value with v-model nom_caisse: 'exempleName' // I want to display this dynamic value in the input }], …
Hazzz
  • 9
  • 4
0
votes
2 answers

Vue two-way data binding issue

My own vue component sends http request to receive array of objects, then I store the answer in data property, and it's fine. Now I want to bind this array to v-model, but when user will input something my array is changed too. I want to store the…
0
votes
2 answers

VueJs Understanding v-model and v-on:click

I'm currently trying to learn VueJS coming from a jQuery background and I've run into something that I either don't understand or trying to do wrongly. I'm using VueJS and Laravel. I add VueJS to my blade templates. I have table set up with a few…
0
votes
1 answer

How to remove object from v-model array when field in the object has changed

I have set up a vue.js file with a checkbox input that will add an object to an array when clicked. But I have another select box input that can change the value of one of the fields in the object, so when I click the checkbox again to unselect that…
0
votes
2 answers

Vue.js v-model input value and populate existing data

I have some data in an array that I want to populate from an input while looping through. And also add more input in case I want to. I don't get any error, but the data is not being populated. My script: data() { return { meta: [] } } My…
Nana Adjei
  • 1,692
  • 1
  • 11
  • 15
0
votes
1 answer

vue v-model does not seem to be working in modal

I am pretty new to vue, and am trying to use it in a bootstrap modal. The relevant div in the modal is as follows.
Nik White
  • 1
  • 3
0
votes
1 answer

VUE on-changed checked and ajax request

Im using bootstrap vue: And I need call ajax with state of this checkbox: onoff: function (filter) { …
rst630
  • 59
  • 2
  • 14
0
votes
1 answer

vue js view not updates with dynamically added v-model

I add some dynamic data to model in vuejs mounted hook but when it is mounted first time it reactivity works and view updates but when I make changes this model view not updates. { props: { requestall: Object, …
Ozal Zarbaliyev
  • 566
  • 6
  • 22
0
votes
3 answers

vue js prop equal to v-model

Why changes take affect on also props when I set v-model equal to props in mount hook. export default{ props: { initial_value: Array, }, data(){ return { component_value: [] } }, mounted(){ this.component_value =…
Ozal Zarbaliyev
  • 566
  • 6
  • 22
0
votes
1 answer

How to commit multiple nested values that are supposed to be in the same Vuex Store object and that are not mapped to the store object?

How would it work if I want to commit the input value and the selected options in the Vuex store (without the "label" string so that the object I send matches my Vuex store object) ? Template
donstripe
  • 3
  • 1
0
votes
1 answer

Problems with modifying props directly in vuejs vuex

I'm working in this web app, trying to build a searchbar filter which allows me to do my own query from writing whatever I want (if the API contains the data), but throws me always the same error: Avoid mutating a prop directly since the value will…
Enrique GF
  • 1,215
  • 3
  • 16
  • 35
0
votes
1 answer

Vue v-model not showing the right default values

I have a reusable TextField component in my Vue application. I now want to have a form where I first fetch some user data and then display it in that form so the user can edit their data. Everything works fine except that it doesn't show the values…
Baspa
  • 1,099
  • 1
  • 18
  • 49
0
votes
2 answers

Dynamic binding of v-model inside v-for loop

I'm trying to dynamically bind v-model to an object property inside of array of objects. I don't know how to do this. The goal is to select user via Select html tag and then print list of user's permissions (from array of objects) to have a…
0
votes
1 answer

Vue.js text input not to show the value of v-model

Is there a way to make an input not to show the value of its pre-defined v-model in Vue.js? For example, let's say I have an input that has "value" as its v-model and this v-model has been predefined somewhere else in the code. I don't want this…
Moe
  • 67
  • 1
  • 1
  • 10