
Security News
pnpm 11.5 Adds Support for Recognizing npm Staged Publishes
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.
mixdashboards
Advanced tools
完整的 Vue 3 显示板组件库,支持大屏、显示屏和移动端展示
npm install mixdashboards
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import ElementPlus from 'element-plus'
import MixDashboards from 'mixdashboards'
import 'element-plus/dist/index.css'
import 'mixdashboards/style'
const app = createApp(App)
const pinia = createPinia()
app.use(pinia)
app.use(ElementPlus)
app.use(MixDashboards)
app.mount('#app')
import { DesignShow, DesignPro, DesignApp } from 'mixdashboards'
import 'mixdashboards/style'
export default {
components: {
DesignShow,
DesignPro,
DesignApp
}
}
<template>
<DesignShow
:script="dashboardData"
:uid="dashboardId"
:enableWebSocket="true"
/>
</template>
<script setup>
import { ref } from 'vue'
import { DesignShow } from 'mixdashboards'
const dashboardData = ref({
sheets: [
{
name: '页面1',
layers: [
{
id: 'layer-1',
name: '图层1',
visible: true,
opacity: 100,
components: [
// 组件配置...
]
}
]
}
],
type: 'show'
})
const dashboardId = ref('dashboard-001')
</script>
const dashboard = window.MixDashboard
// 监听就绪事件
dashboard.on('onReady', () => {
console.log('Dashboard 已就绪')
})
// 切换页签
dashboard.switchSheet(1)
// 显示弹窗
dashboard.showModal({
layerId: 'layer-detail',
width: 80,
height: 60
})
// 更新组件
dashboard.updateComponent('comp-123', {
data: [{ value: 100, label: '数据' }]
})
// 切换主题
dashboard.toggleTheme()
// 监听页签切换
dashboard.on('onSheetChange', (index) => {
console.log('切换到页签:', index)
})
// 监听主题变化
dashboard.on('onThemeChange', (theme) => {
console.log('主题已切换:', theme)
})
// 监听组件更新
dashboard.on('onComponentUpdate', (component) => {
console.log('组件已更新:', component)
})
// 发布数据
dashboard.publish('sensor-data', {
temperature: 25.5,
humidity: 60
})
// 订阅数据
dashboard.subscribe('sensor-data', (data) => {
console.log('收到数据:', data)
})
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| script | Object | - | Dashboard 配置数据(必填) |
| uid | String | - | Dashboard 唯一标识 |
| enableWebSocket | Boolean | true | 是否启用 WebSocket |
init(config?) - 初始化destroy() - 销毁reload() - 重新加载isReady() - 检查是否就绪loadDashboard(data) - 加载数据getDashboard() - 获取数据refreshData() - 刷新数据stopSubscription() - 停止订阅resumeSubscription() - 恢复订阅switchSheet(index) - 切换页签getCurrentSheet() - 获取当前页签getSheets() - 获取所有页签setTabDisplayMode(mode) - 设置页签显示模式setTabsVisible(visible) - 设置页签可见性getLayers(sheetIndex?) - 获取图层列表setLayerVisible(layerId, visible) - 设置图层可见性setLayerOpacity(layerId, opacity) - 设置图层透明度getComponent(id) - 获取组件getAllComponents() - 获取所有组件updateComponent(id, data) - 更新组件setComponentVisible(id, visible) - 设置组件可见性triggerComponentEvent(id, eventType) - 触发组件事件showModal(options) - 显示弹窗hideModal() - 隐藏弹窗toggleModal(options) - 切换弹窗isModalVisible() - 检查弹窗是否可见setTheme(theme) - 设置主题getTheme() - 获取主题toggleTheme() - 切换主题setDefaultTheme(theme) - 设置默认主题setShowThemeToggle(show) - 设置是否显示主题切换按钮查看完整 API 文档:API_DOCUMENTATION.md
# 安装依赖
npm install
# 开发模式
npm run dev
# 类型检查
npm run type-check
# 构建
npm run build
MIT
如有问题或建议,请联系技术支持团队。
Copyright © 2014-2025 Mixlinker Networks Inc. All rights reserved.
FAQs
MixDashboards Display Components - Show, Pro, App
The npm package mixdashboards receives a total of 487 weekly downloads. As such, mixdashboards popularity was classified as not popular.
We found that mixdashboards demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.

Security News
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.