Home > Web Front-end > uni-app > body text

How to assign value in uniapp

藏色散人
Release: 2023-01-13 00:44:10
Original
11891 people have browsed it

Uniapp assignment method: First create a code sample file; then assign the value through "onLoad(){this.mobile=xxxxxxx}".

How to assign value in uniapp

The operating environment of this tutorial: windows7 system, uni-app2.5.1 version, thinkpad t480 computer.

Recommended (free): uni-app development tutorial

uni-app assigns value to input

uniapp It is based on vuejs, so if you want to develop uniapp smoothly, it is recommended to become proficient in vuejs first.

The code is as follows:

<input type="text" v-model="mobile" placeholder="请输入手机号码">  
export default {  
        data() {  
            return {  
                    mobile: &#39;1866666&#39;,  
            }  
        },  
                onLoad() {  
              //这里就是赋值  
              this.mobile = xxxxxxx  
           }  
    }
Copy after login

The above is the detailed content of How to assign value in uniapp. 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!