0account

中文文档
3.4.5-rc3发布于 2023/07/02MITTypeScriptESM + CJS

0account main library

原始使用文档
文档目录6 节
  1. Getting Started
  2. Naming Components
  3. Using this component
  4. Script tag
  5. Node Modules
  6. In a stencil-starter app

Built With Stencil

Stencil Component Starter

This is a starter project for building a standalone Web Component using Stencil.

Stencil is also great for building entire apps. For that, use the stencil-app-starter instead.

Stencil

Stencil is a compiler for building fast web apps using Web Components.

Stencil combines the best concepts of the most popular frontend frameworks into a compile-time rather than run-time tool. Stencil takes TypeScript, JSX, a tiny virtual DOM layer, efficient one-way data binding, an asynchronous rendering pipeline (similar to React Fiber), and lazy-loading out of the box, and generates 100% standards-based Web Components that run in any browser supporting the Custom Elements v1 spec.

Stencil components are just Web Components, so they work in any major framework or with no framework at all.

Getting Started

To start building a new web component using Stencil, clone this repo to a new directory:

git clone https://github.com/ionic-team/stencil-component-starter.git zero-account
cd zero-account
git remote rm origin

and run:

npm install
npm start

To build the component for production, run:

npm run build

To run the unit tests for the components, run:

npm test

Need help? Check out our docs here.

Naming Components

When creating new component tags, we recommend not using stencil in the component name (ex: <stencil-datepicker>). This is because the generated component has little to nothing to do with Stencil; it's just a web component!

Instead, use a prefix that fits your company or any name for a group of related components. For example, all of the Ionic generated web components use the prefix ion.

Using this component

There are three strategies we recommend for using web components built with Stencil.

The first step for all three of these strategies is to publish to NPM.

Script tag

  • Put a script tag similar to this <script type='module' src='https://unpkg.com/[email protected]/dist/zero-account.esm.js'></script> in the head of your index.html
  • Then you can use the element anywhere in your template, JSX, html etc

Node Modules

  • Run npm install zero-account --save
  • Put a script tag similar to this <script type='module' src='node_modules/zero-account/dist/zero-account.esm.js'></script> in the head of your index.html
  • Then you can use the element anywhere in your template, JSX, html etc

In a stencil-starter app

  • Run npm install zero-account --save
  • Add an import to the npm packages import zero-account;
  • Then you can use the element anywhere in your template, JSX, html etc

版本与发布记录

0account 共发布 4 个版本,首次发布于 2023/07/02;过去 12 个月发布了 0 个版本。

版本发布日期距今
3.4.5-rc3latest2023/07/023 年前
3.4.5-rc22023/07/023 年前
3.4.5-rc12023/07/023 年前
1.0.02023/07/023 年前

关于 0account 的常见问题

0account 是什么?

账户主库

如何安装 0account?

在项目目录运行 npm install 0account,或使用 pnpm add / yarn add / bun add。

0account 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

0account 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

0account 可以商用吗?

0account 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

0account 还在维护吗?

最新版本 3.4.5-rc3 发布于 2023/07/02(3 年前);至今共发布 4 个版本,其中过去 12 个月发布了 0 个;首次发布于 2023/07/02。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。