E
E
enchikiben2017-08-03 08:08:27
Vue.js
enchikiben, 2017-08-03 08:08:27

Setting a value in vuejs?

Good afternoon! Tell me how to initialize vuejs to read the value from the input? Otherwise, it overwrites input with its value.

new Vue({
    el: '#form',
    data: {
      text: ""
    }
  });

<input type="text" v-model="text" value="тут текст при редактировании">

It turns out that when opened, it erases the value.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Kulakov, 2017-08-03
@EnChikiben

Just assign a value to a variable:

new Vue({
    el: '#form',
    data: {
      text: "тут текст при редактировании"
    }
  });

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question