S
S
semki0962017-05-18 10:21:36
JavaScript
semki096, 2017-05-18 10:21:36

How to get input value in vuejs?

In jQuery I get like this How to do it in Vuejs?
var value = $('input').val();

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Artem0071, 2017-05-18
@Artem0071

something like this

<input v-model="name">    // привязка к переменной
<script>
data(){
   name: 'some name' // объявление переменной
}
methods:{
  getName(){
      console.log(this.name)  // использование переменной
  }
}
</script>

A
Alexander Aksentiev, 2017-05-18
@Sanasol

https://vuejs.org/v2/guide/forms.html#v-model-with...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question