Home  >  Article  >  Web Front-end  >  How to get the value in input in vue.js

How to get the value in input in vue.js

coldplay.xixi
coldplay.xixiOriginal
2020-11-27 11:49:198673browse

Vue.js method to get the value in the input: 1. Use [$.ref] to identify the element, click the submit method, [this.$ref.] to get the content; 2. Use [v-model] Two-way binding, click submit, [this.upTitleArea] to get the content.

How to get the value in input in vue.js

The operating environment of this tutorial: Windows 7 system, Vue version 2.9.6, Dell G3 computer.

vue.js method to get the value in input:

1, use $.ref to identify the element, code:

How to get the value in input in vue.js

How to get the value in input in vue.js

##Click submit method,

this.$ref. Get the content;

Second, use v-model Two-way binding

How to get the value in input in vue.js

How to get the value in input in vue.js

How to get the value in input in vue.js##Click submit and this.upTitleArea gets the content. Note:

v-model

needs to be declared in data before this can get

Related learning recommendations:
javascript Video tutorial

The above is the detailed content of How to get the value in input in vue.js. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn