欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

詳解微信小程序Page中data數(shù)據(jù)操作和函數(shù)調(diào)用

 更新時(shí)間:2017年09月27日 15:26:16   作者:tangxiujiang  
這篇文章主要介紹了詳解微信小程序Page中data數(shù)據(jù)操作和函數(shù)調(diào)用的相關(guān)資料,希望通過(guò)本文能幫助到大家掌握這方法,需要的朋友可以參考下

微信小程序Page中data數(shù)據(jù)獲取和設(shè)置

一、Page中data數(shù)據(jù)的獲取和設(shè)置:

       1、設(shè)置data數(shù)據(jù) this.setData(object)

setData() 參數(shù)格式:接受一個(gè)對(duì)象,以 key,value 的形式表示將 this.data 中的 key 對(duì)應(yīng)的值改變成 value。其中 key 可以非常靈活,以數(shù)據(jù) 路徑的形式給出,如 array[2].message,a.b.c.d,并且不需要在 this.data 中預(yù)先定義。

this.setData({ 
; encryptionPage: 'display:block', 
}); 

2、獲取data數(shù)據(jù) this.data.object

var text=this.data.text 
Page({ 
 data: { 
 encryption: "color: green; border-bottom-color: green; border-bottom-size: 1px; border-bottom-style: solid;", 
 decryption: "color: gray; border-bottom-color: #F5F5F5; border-bottom-size: 1px; border-bottom-style: solid;", 
 encryptionPage:'display:block', 
 decryptionPage:'display:none', 
 originalText:'', 
 encryptedText:'', 
 originalTextDecode:'', 
 encryptedTextDecode:'', 
 encryptedPassword:'', 
 decryptedPassword:'', 
}, 
 setEncryption: function(e){ 
 this.setData({ 
 encryptionPage: 'display:block', 
 decryptionPage: 'display:none', 
 encryption: "color: green; border-bottom-color: green; border-bottom-size: 1px; border-bottom-style: solid;", 
 decryption: "color: gray; border-bottom-color: #F5F5F5; border-bottom-size: 1px; border-bottom-style: solid;", 
 }) 
 }, 
)} 



如有疑問(wèn)請(qǐng)留言或者到本站社區(qū)交流討論,感謝閱讀,希望能幫助到大家,謝謝大家對(duì)本站的支持!

相關(guān)文章

最新評(píng)論