Home> Web Front-end> Vue.js> body text

How to get the value in input in vue.js

coldplay.xixi
Release: 2021-01-08 18:01:09
Original
8652 people have browsed it

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$.refto 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, usev-modelTwo-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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!