Home >Web Front-end >uni-app >How to assign value in uniapp

How to assign value in uniapp

藏色散人
藏色散人Original
2020-12-09 10:34:4312031browse

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  
           }  
    }

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!

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