@94ai-plus/nf-indicator-plane
v1.0.0
Published
Vue 3 indicator-plane component for CommonUI Plus
Maintainers
Readme
@94ai-plus/nf-indicator-plane
HomePage
指标卡片,保留五种布局以及四个可覆盖插槽。
安装
yarn add @94ai-plus/nf-indicator-plane vue element-plusimport { createApp } from 'vue'
import App from './App.vue'
import NfIndicatorPlane from '@94ai-plus/nf-indicator-plane'
import 'element-plus/dist/index.css'
import '@94ai-plus/nf-indicator-plane/style.css'
const app = createApp(App)
app.use(NfIndicatorPlane)也可从 @94ai-plus/common-ui 具名导入 NfIndicatorPlane,或使用 @94ai-plus/common-ui-resolver 自动导入组件和主题样式。
OEM 主题使用 @94ai-plus/nf-theme-oem/nf-indicator-plane.css 替代默认组件样式,不要重复引入两份主题总样式。
class、style 和原生属性透传到卡片根节点,可直接配置宽度、间距和背景;data.bgColor 显式设置时优先控制背景色。
示例
以下示例采用总包演示,需安装 @94ai-plus/common-ui;单包使用时按上面的方式导入组件和样式。
<script setup>
import { NfConfigProvider, NfIndicatorPlane } from '@94ai-plus/common-ui'
const data = { name: 'Requests', count: 1280, unit: 'req', desc: 'Compared with yesterday', rate: '+12%', bgColor: '#67c23a', color: '#05c9d7' }
</script>
<template>
<NfConfigProvider theme="chalk" locale="zh-CN">
<div class="indicators">
<NfIndicatorPlane v-for="scene in 5" :key="scene" :scene="scene" :data="data" :tooltip-options="{ content: 'Requests: 1280', disabled: false }" />
</div>
</NfConfigProvider>
</template>
<style scoped lang="scss">
.indicators { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
</style>迁移说明
bgColor 的三位/六位十六进制颜色转换为 0.1 透明度背景;其他 CSS 颜色原样使用。业务名称、单位、说明由调用方翻译。
提供 ESM、CJS、browser ES、UMD、声明文件和独立 CSS;浏览器产物仅外置 Vue / Element Plus。 完整属性、事件、插槽和方法见组件文档。
全局默认配置
通过总包的 NfConfigProvider 的 nfIndicatorPlane 配置项设置默认属性。支持响应式更新和嵌套继承,优先级为组件显式属性 → 最近一层配置 → 外层配置 → 组件原有默认值。undefined 继续继承,false、0 和空字符串保留;按属性合并,数组、对象和函数整体替换,不深度合并。初始化选项仍按组件原有生命周期生效,事件、插槽和原生 attributes 在组件上设置,必填业务数据仍需显式提供。详见全局配置文档。
Contributors
感谢每一位参与项目建设的贡献者!
以上为随本版本发布的贡献者统计快照,统计日期与分支见图中说明;仅统计 Git 非合并提交,头像使用姓名首字母,不是 GitLab 个人照片。
License
本项目采用 MIT License 开源许可。
Copyright (c) 2026-present Jiahe Zou, 94 Intelligent Technology Co., Ltd.
