@accordion/active-service-chart 中文文档教程

发布于 3年前 浏览 18 更新于 3年前

npm-module-template

Pre-requisites

  • [Java 8][java-url] (web-component-tester works without any issue with Java 8)
  • [Node.js][nodejs-url] >= 8.16.0
  • [NPM][npm-url] >= 6.4.1 ([NPM][npm-url] comes with [Node.js][nodejs-url], no separate installation is required.)
  • (Optional for non-[VS Code][vscode-url] users) [Syntax Highlighting for lit-html in VS Code][vscode-lit-html-url]
  • [web-component-tester][web-component-tester-url] >= 6.9.2 (For running tests, it's recommended to install globally on your system due to its insanely huge install size by running npm i -g web-component-tester.)

Installation

npm install <name>

Usage

HTML (with native ES modules)

<!doctype html>
<html>
  <head>
    <script type="module" src="/path/to/my-element.js"></script>
  </head>

  <body>
    <my-element></my-element>
  </body>
</html>

JS/ TS file (ES modules)

import { css, html, LitElement } from 'lit-element';
import 'accordion-sidebar.js';

class MainApp extends LitElement {
  public static styles = [
    css`
    :host {
      display: block;
    }

    * {
      box-sizing: border-box;
    }
    `,
  ];

  protected render() {
    return html`
    <my-element></my-element>
    `;
  }
}

npm-module-template

Pre-requisites

  • [Java 8][java-url] (web-component-tester works without any issue with Java 8)
  • [Node.js][nodejs-url] >= 8.16.0
  • [NPM][npm-url] >= 6.4.1 ([NPM][npm-url] comes with [Node.js][nodejs-url], no separate installation is required.)
  • (Optional for non-[VS Code][vscode-url] users) [Syntax Highlighting for lit-html in VS Code][vscode-lit-html-url]
  • [web-component-tester][web-component-tester-url] >= 6.9.2 (For running tests, it's recommended to install globally on your system due to its insanely huge install size by running npm i -g web-component-tester.)

Installation

npm install <name>

Usage

HTML (with native ES modules)

<!doctype html>
<html>
  <head>
    <script type="module" src="/path/to/my-element.js"></script>
  </head>

  <body>
    <my-element></my-element>
  </body>
</html>

JS/ TS file (ES modules)

import { css, html, LitElement } from 'lit-element';
import 'accordion-sidebar.js';

class MainApp extends LitElement {
  public static styles = [
    css`
    :host {
      display: block;
    }

    * {
      box-sizing: border-box;
    }
    `,
  ];

  protected render() {
    return html`
    <my-element></my-element>
    `;
  }
}
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文