在微信小程序中定义页面变量的方法
1.首先,打开微信开发者工具,在小程序项目文件中打开一个wxs文件;
2.在文件中,定义一个变量var username,并赋值,表示页面变量;
var username = "null"modul.exports.getweekday = getweek
var username = "null"
modul.exports.getweekday = getweek
3.最后,在其他页面使用console.log()方法调用变量即可;
console.log(username);modul.exports.getweekday = getweek;
console.log(username);
modul.exports.getweekday = getweek;