auth0-lock

Auth0 Lock

Lock

Auth0is an authentication broker that supports both social and enterprise identity providers, including Active Directory, LDAP, Google Apps, and Salesforce.

Table of Contents

  1. Install
  2. Cross Origin Authentication
  3. API
  4. Browser Compatibility
  5. Issue Reporting
  6. Author
  7. License

Install

From CDN

<!-- Latest patch release (recommended for production) -->
<script src="https://cdn.auth0.com/js/lock/11.22.2/lock.min.js"></script>

From npm

npm install auth0-lock

Then you can import Auth0Lockor Auth0LockPasswordlesslike this:

import Auth0Lock from 'auth0-lock';
// OR
import { Auth0Lock } from 'auth0-lock';
import { Auth0LockPasswordless } from 'auth0-lock';

After installing the auth0-lockmodule, you'll need to bundle it up along with all of its dependencies. See examples for browserifyand webpack.

It is expected that you use the development mode when working on your app, and the production mode when deploying your app to the users. You can find instructions for building your app for production with different module bundlers here.

If you are targeting mobile audiences, we recommended that you add:

<meta name="viewport" content="width=device-width, initial-scale=1"/>

Cross-Origin Authentication

Lock uses Cross-Origin Authentication, make sure you understand the considerations you need to take into account by reading the Cross-Origin Authentication documentation.

API

new Auth0Lock(clientID, domain, options)

Initializes a new instance of Auth0Lockconfigured with your application clientIDand your account's domainat Auth0. You can find this information in your application settings.

  • clientId {String}: Your application clientIdin Auth0.
  • domain {String}: Your Auth0 domain. Usually your-account.auth0.com.
  • options {Object}: Allows you to customize the dialog's appearance and behavior. See belowfor the details.

Example

var clientId = "YOUR_AUTH0_APP_CLIENTID";
var domain = "YOUR_DOMAIN_AT.auth0.com";
var lock = new Auth0Lock(clientId, domain);
var accessToken = null;
var profile = null;

lock.on("authenticated", function(authResult) {
  lock.getUserInfo(authResult.accessToken, function(error, profileResult) {
    if (error) {
      // Handle error
      return;
    }

    accessToken = authResult.accessToken;
    profile = profileResult;

    // Update DOM
  });
});

new Auth0LockPasswordless(clientID, domain, options)

Initializes a new instance of Auth0LockPasswordlessconfigured with your application clientIDand your account's domainat Auth0. You can find this information in your application settings.

  • clientId {String}: Your application clientIdin Auth0.
  • domain {String}: Your Auth0 domain. Usually your-account.auth0.com.
  • options {Object}: Allows you to customize the dialog's appearance and behavior. See belowfor the details.

If both SMS and email passwordless connections are enabled in the dashboard, Lock will pick email by default. If you want to conditionally pick email or SMS, use the allowedConnectionsoption, for example: allowedConnections: ['sms'].

For more information, read our passwordless docs.

Example

var clientId = "YOUR_AUTH0_APP_CLIENTID";
var domain = "YOUR_DOMAIN_AT.auth0.com";
var lock = new Auth0LockPasswordless(clientId, domain);
var accessToken = null;
var profile = null;

lock.on("authenticated", function(authResult) {
  lock.getUserInfo(authResult.accessToken, function(error, profileResult) {
    if (error) {
      // Handle error
      return;
    }

    accessToken = authResult.accessToken;
    profile = profileResult;

    // Update DOM
  });
});

getUserInfo(accessToken, callback)

Once the user has logged in and you are in possession of an access token, you can obtain the profile with getUserInfo.

  • accessToken {String}: User access token.
  • callback {Function}: Will be invoked after the user profile has been retrieved.

Example

lock.getUserInfo(accessToken, function(error, profile) {
  if (!error) {
    alert("hello " + profile.name);
  }
});

on(event, callback)

Lock will emit events during its lifecycle.

  • show: emitted when Lock is shown. Has no arguments.
  • hide: emitted when Lock is hidden. Has no arguments.
  • unrecoverable_error: emitted when there is an unrecoverable error, for instance when no connection is available. Has the error as the only argument.
  • authenticated: emitted after a successful authentication. Has the authentication result as the only argument.
  • authorization_error: emitted when authorization fails. Has the error as the only argument.
  • hash_parsed: every time a new Auth0Lock object is initialized in redirect mode (the default), it will attempt to parse the hash part of the URL looking for the result of a login attempt. This is a low-levelevent for advanced use cases and authenticatedand authorization_errorshould be preferred when possible. After that, this event will be emitted with nullif it couldn't find anything in the hash. It will be emitted with the same argument as the authenticatedevent after a successful login or with the same argument as authorization_errorif something went wrong. This event won't be emitted in popup mode because there is no need to parse the URL's hash part.
  • forgot_password ready: emitted when the "Forgot password" screen is shown.
  • forgot_password submit: emitted when the user clicks on the submit button of the "Forgot password" screen.
  • signin submit: emitted when the user clicks on the submit button of the "Login" screen.
  • signup submit: emitted when the user clicks on the submit button of the "Sign up" screen.
  • signup success: emitted when the user successfully signs up.
  • signup error: emitted when signup fails. Has the error as an argument.
  • federated login: emitted when the user clicks on a social connection button. Has the connection name and the strategy as arguments.
  • sso login: emitted when the user clicks on an enterprise SSO connection button. Has the lock ID, connection object, and field name as arguments.

show(options)

Displays the widget, allowing you to override some options.

  • options {Object}: Allows you to customize some aspect of the dialog's appearance and behavior. The options allowed in here are a subset of the options allowed in the constructor and will override them: allowedConnections, auth.params, allowLogin, allowSignUp, allowForgotPassword, initialScreen, rememberLastLogin, flashMessageand languageDictionary. See belowfor the details. Keep in mind that auth.paramswill be fully replaced and not merged.

Example

// without options
lock.show();

// will override the allowedConnections option passed to the constructor, if any
lock.show({allowedConnections: ["twitter", "facebook"]})

// will override the entire auth.params object passed to the constructor, if any
lock.show({auth: {params: {state: 'auth_state'}}})

resumeAuth(hash, callback)

If you set the auth.autoParseHashoption to false, you'll need to call this method to complete the authentication flow. This method is useful when you're using a client-side router that uses a #to handle URLs (angular2 with useHashor react-router with hashHistory).

  • hash {String}: The hash fragment received from the redirect.
  • callback {Function}: Will be invoked after the parse is done. Has an error (if any) as the first argument and the authentication result as the second one. If there is no hash available, both arguments will be null.

Example

lock.resumeAuth(hash, function(error, authResult) {
  if (error) {
    alert("Could not parse hash");
  }
  console.log(authResult.accessToken);
});

logout(options)

Logs out the user.

  • options {Object}: This is optional and follows the same rules as this.

Example

lock.logout({ returnTo: 'https://myapp.com/bye-bye' });

checkSession(params, callback)

The checkSession method allows you to acquire a new token from Auth0 for a user who is already authenticated against the universal login page for your domain. The method accepts any valid OAuth2 parameters that would normally be sent to authorize. In order to use this method, you have to enable Web Origins for your application. For more information, see Using checkSession to acquire new tokens.

  • params {Object}: OAuth2 params object to send to Auth0's servers.
  • callback {Function}: Will be invoked after the response from the server is returned. Has an error (if any) as the first argument and the authentication result as the second one.

Example

lock.checkSession({}, function (error, authResult) {
  if (error || !authResult) {
    lock.show();
  } else {
    // user has an active session, so we can use the accessToken directly.
    lock.getUserInfo(authResult.accessToken, function (error, profile) {
      console.log(error, profile);
    });
  }
});

Customization

The appearance of the widget and the mechanics of authentication can be customized with an optionsobject which has one or more of the following properties. Each method that opens the dialog can take an optionsobject as its first argument.

UI options

  • allowedConnections {Array}: List of connection that will be available to perform the authentication. It defaults to all enabled connections.
  • autoclose {Boolean}: Determines whether or not the Lock will be closed automatically after a successful sign in. If the Lock is not closableit won't be closed even if this option is set to true. Defaults to false.
  • autofocus {Boolean}: Determines whether or not the first input on the screen, that is the email or phone number input, should have focus when the Lock is displayed. Defaults to falsewhen a containeroption is provided or the Lock is being rendered on a mobile device. Otherwise, it defaults to true.
  • avatar {Object}: Determines whether or not an avatar and a username should be displayed on the Lock's header once an email or username has been entered and how to obtain it. By default avatars are fetched from Gravatar. Supplying nullwill disable the functionality. To fetch avatar from other provider see below.
  • container {String}: The idof the HTML element where the Lock will be rendered. This makes the Lock appear inline instead of in a modal window.
  • language {String}: Specifies the language of the widget. Defaults to "en". Supported languages are:
  • languageDictionary {Object}: Allows you to customize every piece of text displayed in the Lock. Defaults to {}. See below Language Dictionary Specificationfor the details.
  • closable {Boolean}: Determines whether or not the Lock can be closed. When a containeroption is provided its value is always false, otherwise it defaults to true.
  • popupOptions {Object}: Allows you to customize the location of the popup in the screen. Any position and size featureallowed by window.openis accepted. Defaults to {}.
  • rememberLastLogin {Boolean}: Determines whether or not to show a screen that allows you to quickly log in with the account you used the last time when the initialScreenoption is set to "login"(the default). Defaults to true.
  • flashMessage {Object}: Shows an erroror successflash message when Lock is shown.
    • type {String}: The message type, it should be erroror success.
    • text {String}: The text to show.
  • allowAutocomplete {Boolean}: Determines whether or not the email or username inputs will allow autocomplete (<input autocomplete />). Defaults to false.
  • scrollGlobalMessagesIntoView {Boolean}: Determines whether or not a globalMessage should be scrolled into the user's viewport. Defaults to true.
  • allowShowPassword {Boolean}: Determines whether or not add a checkbox to show the password when typing it. Defaults to false.
  • allowPasswordAutocomplete {Boolean}: Determines whether the password field will allow autocomplete; setting this to trueis required for password manager support and to avoid many cases of adverse behavior. Defaults to false.

Theming options

Theme options are grouped in the themeproperty of the optionsobject.

var options = {
  theme: {
    labeledSubmitButton: false,
    logo: "https://example.com/assets/logo.png",
    primaryColor: "green",
    authButtons: {
      connectionName: {
        displayName: "...",
        primaryColor: "...",
        foregroundColor: "...",
        icon: "https://.../logo.png"
      }
    }
  }
};
  • labeledSubmitButton {Boolean}: Indicates whether or not the submit button should have a label. Defaults to true. When set to falsean icon will be shown. The labels can be customized through the languageDictionary.
  • logo {String}: Url for an image that will be placed in the Lock's header. Defaults to Auth0's logo.
  • primaryColor {String}: Defines the primary color of the Lock, all colors used in the widget will be calculated from it. This option is useful when providing a custom logoto ensure all colors go well together with the logo's color palette. Defaults to "#ea5323".
  • authButtons {Object}: Allows the customization of the custom oauth2 login buttons.
    • displayName {String}: The name to show instead of the connection name.
    • primaryColor {String}: The button's background color. Defaults to "#eb5424".
    • foregroundColor {String}: The button's text color. Defaults to "#FFFFFF".
    • icon {String}: The icon's url for the connection. For example:"https://site.com/logo.png".

Authentication options

Authentication options are grouped in the authproperty of the optionsobject. The default scope used by Lock is openid profile email.

var options = {
  auth: {
   params: {
    param1: "value1",
    scope: "openid profile email"
   },
   autoParseHash: true,
   redirect: true,
   redirectUrl: "some url",
   responseMode: "form_post",
   responseType: "token",
   sso: true,
   connectionScopes: {
    connectionName: [ 'scope1', 'scope2' ]
   }
  }
};
  • params {Object}: Specifies extra parameters that will be sent when starting a login. Defaults to {}.
  • autoParseHash {Boolean}: When set to true, Lock will parse the window.location.hashstring when instantiated. If set to false, you'll have to manually resume authentication using the resumeAuthmethod.
  • redirect {Boolean}: When set to true, the default, redirect modewill be used. Otherwise, popup modeis chosen. See belowfor more details.
  • redirectUrl {String}: The URL Auth0 will redirect back to after authentication. Defaults to the empty string ""(no redirect URL).
  • responseMode {String}: Should be set to "form_post"if you want the code or the token to be transmitted via an HTTP POST request to the redirectUrlinstead of being included in its query or fragment parts. Otherwise, it should be omitted.
  • responseType {String}: Should be set to "token"for Single Page Applications, and "code"otherwise. Also, "id_token"is supported for the first case. Defaults to "code"when redirectUrlis provided, and to "token"otherwise.
  • sso {Boolean}: Determines whether Single Sign-On is enabled or not in Lock. The Auth0 SSO session will be created regardless of this option if SSO is enabled for your application or tenant.
  • connectionScopes {Object}: Allows you to set scopes to be sent to the oauth2/social connection for authentication.

Database options

  • additionalSignUpFields {Array}: Allows you to provide extra input fields during sign up. See belowmore for details. Defaults to [].
  • allowLogin {Boolean}: When set to falsethe widget won't display the login screen. This is useful if you want to use the widget just for signups (the login and sign up tabsin the sign up screenwill be hidden) or to reset passwords (the back buttonin the forgot password screenwill be hidden). In such cases you may also need to specify the initialScreen, allowForgotPasswordand allowSignUpoptions. It defaults to true.
  • allowForgotPassword {Boolean}: When set to falsehides the "Don't remember your password?"link in the login screen_, making the _forgot password screenunreachable. Defaults to true. Keep in mind that if you are using a database connection with a custom databasewhich doesn't have a change password scriptthe forgot password screen won't be available.
  • allowSignUp {Boolean}: When set to falsehides the login and sign up tabsin the login screen_, making the _sign up screenunreachable. Defaults to true. Keep in mind that if the database connection has sign ups disabledor you are using a custom databasewhich doesn't have a _create script_, then the sign up screen won't be available.
  • defaultDatabaseConnection {String}: Specifies the database connection that will be used when there is more than one available.
  • initialScreen {String}: Name of the screen that will be shown when the widget is opened. Valid values are "login", "signUp", and "forgotPassword". If this option is left unspecified, the widget will pick the first screen that is available from the previous list. If you set initialScreento "forgotPassword"we recommend that you set allowLoginto "false", otherwise a back button will be shown in the forgot password screen and it might not be clear to the user where that back button will take them.
  • loginAfterSignUp {Boolean}: Determines whether or not the user will be automatically signed in after a successful sign up. Defaults to true.
  • forgotPasswordLink {String}: URL for a page that allows the user to reset her password. When set to a non-empty string, the user will be linked to the provided URL when clicking the "Don't remember your password?"link in the login screen.
  • showTerms {Boolean}: When set to truedisplays the languageDictionary.signUpTermsstring. Defaults to true.
  • mustAcceptTerms {Boolean}: When set to truedisplays a checkbox input along with the terms and conditions that must be checked before signing up. The terms and conditions can be specified via the languageDictionaryoption, see the example below. Defaults to false.
  • prefill {Object}: Allows you to set the initial value for the emailand/or usernameinputs, e.g. {prefill: {email: "someone@auth0.com", username: "someone"}}. When omitted no initial value will be provided.
  • signUpLink {String}: URL for a page that allows the user to sign up. When set to a non-empty string, the user will be linked to the provided URL when clicking the sign uptab in the login screen.
  • usernameStyle {String}: Determines what will be used to identify the user for a Database connection that has the requires_usernameflag set, otherwise it will be ignored. Possible values are "username"and "email"and by default both usernameand emailare allowed.

Enterprise options

  • defaultEnterpriseConnection {String}: Specifies the enterprise connection which allows you to log in using a username and a password that will be used when there is more than one available or there is a database connection. If a defaultDatabaseConnectionis provided the database connection will be used and this option will be ignored.

Example

var options = {
  container: "myContainer",
  closable: false,
  languageDictionary: {
    signUpTerms: "I agree to the <a href='/terms' target='_new'>terms of service</a> and <a href='/privacy' target='_new'>privacy policy</a>.",
    title: "My Company",
  },
  autofocus: false
};

Passwordless options

  • passwordlessMethod {String}: When using Auth0LockPasswordlesswith an email connection, you can use this option to pick between sending a codeor a magic linkto authenticate the user. Available values for email connections are codeand link. Defaults to code. SMS passwordless connections will always use code.

Other options

  • configurationBaseUrl {String}: Overrides application settings base URL. By default it uses Auth0's CDN URL when the domainhas the format *.auth0.com. Otherwise, it uses the provided domain.
  • languageBaseUrl {String}: Overrides the language source URL for Auth0's provided translations. By default it uses to Auth0's CDN URL https://cdn.auth0.com.
  • hashCleanup {Boolean}: When enabled, it will remove the hash part of the callback URL after the user authentication. Defaults to true.
  • connectionResolver {Function}: When in use, provides an extensibility point to make it possible to choose which connection to use based on the username information. Has username, context, and callbackas parameters. The callback expects an object like: {type: 'database', name: 'connection name'}. This only works for database connections.Keep in mind that this resolver will run in the form's onSubmitevent, so keep it simple and fast. This is a beta feature. If you find a bug, please open a GitHub issue.
var options = {
  connectionResolver: function (username, context, cb) {
    var domain = username.includes('@') && username.split('@')[1];
    if (domain) {
      // If the username is test@auth0.com, the connection used will be the `auth0.com` connection.
      // Make sure you have a database connection with the name `auth0.com`.
      cb({ type: 'database', name: domain });
    } else {
      // Use the default approach to figure it out the connection
      cb(null);
    }
  }
}

Language Dictionary Specification

A language dictionary is an object that allows you to customize every piece of text the Lock needs to display. For instance, the following code will change the title displayed in the header and the placeholder for the email field.

var options = {
  languageDictionary: {
    emailInputPlaceholder: "Please enter your email",
    title: "My Company"
  },
};

Additional sign up fields

Extra input fields can be added to the sign up screen with the additionalSignUpFieldsoption. Every input must have a nameand a placeholder, and an iconURL can also be provided. Also, the initial value can be provided with the prefilloption, which can be a stringwith the value or a functionthat obtains it. Other options depend on the type of the field, which is defined via the typeoption and defaults to "text".

Additional sign up fields are rendered below the default fields in the order they are provided.

Text field

A validatorfunction can also be provided.

var options = {
  additionalSignUpFields: [{
    name: "address",
    placeholder: "enter your address",
    // The following properties are optional
    ariaLabel: "Address",
    icon: "https://example.com/assests/address_icon.png",
    prefill: "street 123",
    validator: function(address) {
      return {
         valid: address.length >= 10,
         hint: "Must have 10 or more chars" // optional
      };
    }
  }]
};

If you don't provide a validatorfunction a default validator is applied, which requires the text field to contain some value (be non-empty). You can make a field optional by using a validator that always return true:

var options = {
  additionalSignUpFields: [{
    name: "address",
    placeholder: "enter your address (optional)",
    validator: function() {return true;}
  }]
};

If you want to save the value of the attribute in the root of your profile, use storage: 'root'. Only a subset of values can be stored this way. The list of attributes that can be added to your root profile is here. By default, every additional sign up field is stored inside the user_metadataobject.

var options = {
  additionalSignUpFields: [{
    name: "name",
    storage: "root"
  }]
};
Select field

To specify a select field type: "select"needs to be provided along with the optionsproperty.

var options = {
  additionalSignUpFields: [{
    type: "select",
    name: "location",
    placeholder: "choose your location",
    options: [
      {value: "us", label: "United States"},
      {value: "fr", label: "France"},
      {value: "ar", label: "Argentina"}
    ],
    // The following properties are optional
    ariaLabel: "Location",
    icon: "https://example.com/assests/location_icon.png",
    prefill: "us"
  }]
}

The optionsand the prefillvalue can be provided through a function.

var options = {
  additionalSignUpFields: [{
    type: "select",
    name: "location",
    placeholder: "choose your location",
    options: function(cb) {
      // obtain options, in case of error you call cb with the error in the
      // first arg instead of null
      cb(null, options);
    },
    ariaLabel: "Location",
    icon: "https://example.com/assests/location_icon.png",
    prefill: function(cb) {
      // obtain prefill, in case of error you call cb with the error in the
      // first arg instead of null
      cb(null, prefill);
    }
  }]
}
Checkbox field

To specify a checkbox field use: type: "checkbox"The prefillvalue can determine the default state of the checkbox and it is required.

var options = {
  additionalSignUpFields: [{
    type: "checkbox",
    name: "newsletter",
    prefill: "true",
    placeholder: "I hereby agree that I want to receive marketing emails from your company",
    // placeholderHTML - is an optional field  and overrides the value of placeholder
    placeholderHTML: "<b>I hereby agree that I want to receive marketing emails from your company</b>",
    // ariaLabel - is an optional field
    ariaLabel: "Activate Newsletter"
  }]
}
Hidden field

To specify a hidden field use: type: "hidden". Both the valueand nameproperties are required.

var options = {
  additionalSignUpFields: [{
    type: "hidden",
    name: "signup_code",
    value: "foobar123"
  }]
}

Avatar provider

Lock can show avatars fetched from anywhere. A custom avatar provider can be specified with the avataroption by passing an object with the keys urland displayName. Both properties are functions that take an email and a callback function.

var options = {
  avatar: {
    url: function(email, cb) {
      // obtain URL for email, in case of error you call cb with the error in
      // the first arg instead of null
      cb(null, url);
    },
    displayName: function(email, cb) {
      // obtain displayName for email, in case of error you call cb with the
      // error in the first arg instead of null
      cb(null, displayName);
    }
  }
};

Popup mode

A popup window can be displayed instead of redirecting the user to a social provider website. While this has the advantage of preserving page state, it has some issues. Often times users have popup blockers that prevent the login page from even displaying. There are also known issues with mobile browsers. For example, in recent versions of Chrome on iOS, the login popup does not close properlyafter login. For these reasons, we encourage developers to avoid this mode, even with Single Page Apps.

If you decide to use popup mode you can activate it by passing the option auth: {redirect: false}when constructing Auth0Lock.

var clientId = "YOUR_AUTH0_APP_CLIENTID";
var domain = "YOUR_DOMAIN_AT.auth0.com";
var options = {
  auth: {
    redirect: false
  }
};

var lock = new Auth0Lock(clientId, domain, options);
lock.show();

More information can be found in Auth0's documentation.

Browser Compatibility

We ensure browser compatibility in Chrome, Safari, Firefox and IE >= 10. We currently use zuulalong with Saucelabsto run integration tests on each push.

Issue Reporting

If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Programdetails the procedure for disclosing security issues.

Author

Auth0

License

This project is licensed under the MIT license. See the LICENSEfile for more info.

Repository

https://github.com/auth0/lock


上一篇:unreleased
下一篇:webpack-custom-var-library-name-plugin

相关推荐

  • 解决typescript Cannot redeclare block-scoped variable

    没有依赖框架来写typescript,纯粹新建一个ts文件,使用tsc编译成js后,ts文件里的声明的变量、函数名都会报错: 或者 其实我们写的ts代码是没有问题的,只是ts会对我...

    3 个月前
  • 神奇的inline-block

    inlineblock 我们都知道意味着该元素表现形式是inline,也就是不会独占一行,但是又可以给它定义宽和高。 那么如果一个元素定义了 但是没有定义宽呢?这个元素的width是多少呢? 答案...

    2 年前
  • 由一个绝对定位引发overflow:auto滚动问题产生的关于包含块(containing block)的思考

    前言 今天在项目中有一个需求,就是一个可滚动的列表的每一列鼠标悬浮上去就会产生一个浮动框显示其详细内容。简化下情景的代码如下: 预览(https://jsfiddle.net/lijie33...

    2 年前
  • 搞点好玩儿的,如何做一个你自己的&quot;ad-block&quot;

    解释一下,是类似adblock的插件,但是它的功能不是屏蔽广告,而是【屏蔽文章】【屏蔽作者】,在你不想看的文章或者帖子上面右键,你就能选择屏蔽作者还是屏蔽文章,下次就不会再看到他的文章了!是不是很好玩...

    20 天前
  • 我们为什么需要 lock 文件

    前言 从 Yarn 横空出世推出 lock 文件以来,已经两年多时间了,npm 也在 5.0 版本加入了类似的功能,lock 文件越来越被开发者们接收和认可。本篇文章想从前端视角探讨一下我们为什么...

    2 年前
  • 并发编程之可重入锁ReentrantLock

    一、简介 ReentrantLock是可重入锁。 可重入:指同一个线程可以多次获取同一把锁。如下所示,method1 和 method2 使用的是同一个锁,method1中调用method2时,调用的...

    4 天前
  • 入门display:inline-block运用

    这是我第一篇博客,是我新的开始,我要用博客记录我的学习之旅,在这里我要感谢我的哥哥,他带我开阔了眼界,纠正了我的格局,给我带来了正能量。我是一个小白,学习的路还很长很长,学习了10天HTML与css,...

    2 年前
  • 你需要知道的关于package-lock.json

    什么时候产生的? 如果你的NPM升级到v5.x.x版本, 你就会发现一个新的文件会自动创建, Packagelock.json. 在Packagelock刚开始时候, 有一些问题. 比如:模块找...

    2 年前
  • 你想知道关于package-lock.json的一切,但是太害怕了问了?

    图片描述(https://img.javascriptcn.com/d6e6e080f1af6c9ee4243c957005033d "图片描述") 简介 如果你已经将节点包管理(npm)更新到...

    1 年前
  • 从Script到Code Blocks、Code Behind到MVC、MVP、MVVM

    刚过去的周五(314)例行地主持了技术会议,主题正好是《UI层的设计模式——从Script、Code Behind到MVC、MVP、MVVM》,是前一天晚上才定的,中午花了半小时准备了下就开讲了。

    2 年前

官方社区

扫码加入 JavaScript 社区