module.exports = {
showToast: function(n) {
return new Promise(function(o, t) {
wx.showToast({
title: n.title,
icon: n.icon || "none",
image: n.image,
duration: n.duration || 2e3,
mask: n.mask || !1,code
success: function() {
o();
},
fail: function() {
t();
}
});
});
},
showLoading: function(n) {
return new Promise(function(o, t) {
wx.showLoading({
title: n.title,
mask: n.mask,
success: function() {
o();
},
fail: function() {
t();
}
});
});
},
hideToast: function() {
return new Promise(function(n, o) {
wx.hideToast(), n();
});
},
hideLoading: function() {
return new Promise(function(n, o) {
wx.hideLoading(), n();
});
},
showModal: function(n) {
return new Promise(function(o, t) {
wx.showModal({
title: n.title || "",
content: n.content || "",
showCancel: n.showCancel || !1,
cancelText: n.cancelText || "取消",
cancelColor: n.cancelColor || "#202020",
confirmText: n.confirmText || "确定",
confirmColor: n.confirmColor || "#0084ff",
success: function(n) {
o({
confirm: n.confirm,
cancel: n.cancel
});
},
fail: function(n) {
t(n);
}
});
});
},
showActionSheet: function(n) {
return new Promise(function(o, t) {
wx.showActionSheet({
itemList: n.itemList,
itemColor: n.itemColor,
success: function(n) {
o({
tapIndex: n.tapIndex
});
},
fail: function() {
t();
}
});
});
}
};
在做微信小程序的时候 打开js 包看代码的时候里面有个code 关键字,找到后是在export 模块里面但是里面有个code 不知道怎么来的不知道这个语法啥意思,求人指教,谢谢
就在这行代码(mask: n.mask || !1,code)
请问这个是什么意思?有人知道吗?
code
应该是个全局变量,那行代码其实是这样:可以直接写code,糖语法。