@yingzhixiaoyi/ui-web-components
v0.0.1
Published
Standalone Custom Elements for Justin loading UI
Readme
@yingzhixiaoyi/ui-web-components
将加载态能力作为标准 Custom Elements 提供给 Vue/Vite、普通 HTML 和远程组件页面。
能力边界
justin-loading-btn:loading、disabled、loading-mode和原生click。justin-loading-page:text、min-height和可访问状态标记。- Shadow DOM 样式隔离;不执行用户输入 HTML,不依赖宿主 Vue 应用。
本包不负责接口请求、业务状态、微前端通信或远程脚本安全策略。
使用
import { registerJustinUIWebComponents } from '@yingzhixiaoyi/ui-web-components'
registerJustinUIWebComponents()<justin-loading-page text="正在加载" min-height="160px"></justin-loading-page>
<justin-loading-btn loading>提交</justin-loading-btn>HTML 页面可加载 dist/index.iife.js 后调用 JustinUIWebComponents.registerJustinUIWebComponents()。
Vue 运行时说明
本包为了让 Custom Elements 在普通 HTML、远程组件和非 Vue 宿主中独立运行,会将 Vue 打包进产物;它不是普通 Vue 组件库,也不会复用业务项目的 Vue 实例。若业务项目只使用 Vue 组件,应使用 @yingzhixiaoyi/ui,避免同时引入两份 Vue 运行时。
