我添加到meteor“accounts-ui account-password”包中,我想在用户登录时执行此功能。
({ function() { alert("Hello") } })
但我在 google only hacks 中没有找到任何功能。
最佳答案
您可以使用Accounts.onLogin
像这样,
if (Meteor.isClient) {
Accounts.onLogin(function () {
var user = Meteor.user();
alert(user.profile.firstName + ' is logged in.');
}
}
注意:我自己没有使用过它。
关于javascript - 用户登录时的 meteor 事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36960233/