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

How to get the value in input in vue.js

coldplay.xixi
Release: 2021-01-08 18:01:09
Original
8799 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 $.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!

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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template