在微信小程序中定義頁面變量的方法
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;