在方法里如何调用page
1个回答
展开全部
如下所示,在函数中如果不加this的话控制台会报错:
this.initalEncryptedInput();
onLoad:function(){
this.initalEncryptedInput();
}
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:'',
encryptedInputFocus:false,
originalTextFocus:false,
decryptedInputFocus:false,
},
initalEncryptedInput:function(){
let pass = wx.getStorageSync('encode');
if(pass == '' || pass == undefined) {
this.setData({
encryptedInputFocus: true,
});
} else {
this.setData({
encryptedPassword: pass,
originalTextFocus: true,
});
}
},
onLoad:function(){
this.initalEncryptedInput();
},
})
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询