Skip to content

accounts-ui

Meteor 账户的交钥匙用户界面。

¥A turn-key user interface for Meteor Accounts.

要将账户和一组登录控件添加到应用,请添加 accounts-ui 包和至少一个登录提供程序包:accounts-passwordaccounts-facebookaccounts-githubaccounts-googleaccounts-twitteraccounts-weibo

¥To add Accounts and a set of login controls to an application, add the accounts-ui package and at least one login provider package: accounts-password, accounts-facebook, accounts-github, accounts-google, accounts-twitter, or accounts-weibo.

然后只需将 {{> loginButtons}} 辅助程序添加到 HTML 文件中。这将在页面上放置一个登录小部件。如果只配置了一个提供商并且它是外部服务,这将添加登录/注销按钮。如果你使用 accounts-password 或使用多个外部登录服务,这将添加一个 "登录" 链接,该链接会打开一个带有登录选项的下拉菜单。如果你计划将登录下拉菜单放置在屏幕的右边缘,请使用 {{> loginButtons align="right"}} 以使下拉菜单自行布局而不会超出屏幕边缘。

¥Then simply add the {{> loginButtons}} helper to an HTML file. This will place a login widget on the page. If there is only one provider configured and it is an external service, this will add a login/logout button. If you use accounts-password or use multiple external login services, this will add a "Sign in" link which opens a dropdown menu with login options. If you plan to position the login dropdown in the right edge of the screen, use {{> loginButtons align="right"}} in order to get the dropdown to lay itself out without expanding off the edge of the screen.

要配置 {{> loginButtons}} 的行为,请使用 Accounts.ui.config

¥To configure the behavior of {{> loginButtons}}, use Accounts.ui.config.

accounts-ui 还包括模式弹出对话框,用于处理来自 sendResetPasswordEmailsendVerificationEmailsendEnrollmentEmail 的链接。这些不必手动放置在 HTML 中:它们在加载 URL 时自动激活。

¥accounts-ui also includes modal popup dialogs to handle links from sendResetPasswordEmail, sendVerificationEmail, and sendEnrollmentEmail. These do not have to be manually placed in HTML: they are automatically activated when the URLs are loaded.

如果你想进一步控制账户系统的外观和感觉,我们建议你阅读 Meteor 指南的 useraccounts 部分。

¥If you want to control the look and feel of your accounts system a little more, we recommend reading the useraccounts section of the Meteor Guide.