How to style Meteor.js loginButtons?

前端 未结 4 1645
暖寄归人
暖寄归人 2020-12-07 17:39

The docs specify to use the template {{> loginButtons}} to implement the default login buttons.

What is the best way to apply my own styles to this?<

4条回答
  •  余生分开走
    2020-12-07 18:30

    Create your own html template similar to this below. Style it to your taste.

    meteor add accounts-password accounts-ui

                    
    

    You can now call Meteor.loginWithPassword in the template event like so:

    Template.login.events({
        'submit .login-form': function(e) {
            e.preventDefault();
            var email = e.target.email.value;
            var password = e.target.password.value;
          Meteor.loginWithPassword(email, password,function(error){
                if(error) {
                    //do something if error occurred or 
                }else{
                   FlowRouter.go('/');
                }
            });
         }
     });
    

    You can create another form for registration as well.

    Just call Accounts.createUser(object, callback);

提交回复
热议问题