@oas-ui/core
v2.4.0
Published
OAS-UI 基础运行时(Web Components 基类与工具)
Maintainers
Readme
@oas-ui/core
中文 | English
OAS-UI 组件运行时基础包 —— 提供 OASElement 组件基类(Shadow DOM 生命周期、属性观察、oas-* 事件封装、locale / 配置注入、DSD 水合支持)。@oas-ui/ui 中所有组件均继承自该类。
大多数情况不需要直接使用 —— 仅当编写自定义组件或需要底层能力时才引入。
import { OASElement } from '@oas-ui/core'提供的能力
render()/updating()生命周期模板observedAttributes静态声明 +attributeChanged自动触发更新emit()派发oas-*前缀事件(可选bubbles/composed)t()国际化文案查询(配合@oas-ui/i18n)- 主题上下文(
data-theme)与 DSD 水合衔接
相关包
| 包 | 作用 |
| --- | --- |
| @oas-ui/ui | 组件库主包(基于本包构建) |
| @oas-ui/i18n | 框架无关 locale registry |
中文 | English
@oas-ui/core — the runtime base package of OAS-UI. It provides the OASElement base class (Shadow DOM lifecycle, attribute observation, oas-* event helpers, locale / config injection, DSD hydration support). Every component in @oas-ui/ui extends this class.
You normally don't need to use it directly — only when authoring custom components or needing lower-level capabilities.
import { OASElement } from '@oas-ui/core'What it provides
render()/updating()lifecycle templatesobservedAttributesstatic declaration + automatic updates onattributeChangedemit()dispatchesoas-*prefixed events (optionalbubbles/composed)t()localized text lookup (with@oas-ui/i18n)- Theme context (
data-theme) and DSD hydration integration
Related packages
| Package | Purpose |
| --- | --- |
| @oas-ui/ui | Main UI library (built on this package) |
| @oas-ui/i18n | Framework-agnostic locale registry |
