@composy/notice-center-vue

Vue components for @composy/notice-center-core
Install
npm install @composy/notice-center-vue
Latest Version:0.0.2
Vue:3
Older releases:2
License:MIT
Last Updated:Oct 12, 2026
Links: npm
Maintainer: swimly

@composy/notice-center-vue

Vue 3 adapter for @composy/notice-center-core, with Vue components, composables, and plugin exports.

Install

pnpm add @composy/notice-center-vue

The core package is installed as a runtime dependency. Vue is a peer dependency, and vue-demi provides the compatibility layer.

Quick start

<script setup lang="ts">
import type { NoticeMessage } from '@composy/notice-center-vue'
import { NoticeCenter } from '@composy/notice-center-vue'
import { ref } from 'vue'

const messages = ref<NoticeMessage[]>([
  {
    id: 'approval-1',
    title: '审批待办',
    summary: '有一个审批请求等待处理',
    category: 'todo',
    priority: 'normal',
    status: 'unread',
    createdAt: new Date().toISOString(),
  },
])
</script>

<template>
  <NoticeCenter :messages="messages" @message:read="ids => console.info('已读', ids)" />
</template>

The host application must provide the global Color and Size CSS variables from packages/color and packages/size (--ld-*). The component emits message:read, message:delete, message:click, action:click, category:change, search, preference:change, and theme:change.

Package layout

packages/vue/
├── .ldesign/             # Builder, ESLint, and ESM/CJS TypeScript configs
├── src/                  # Vue components, composables, and plugins
├── tsconfig.json         # Compatibility shim for the canonical ESM config
├── tsconfig.cjs.json     # Compatibility shim for the canonical CJS config
└── package.json

Build outputs

  • es/ contains the ESM package entry and declarations.
  • esm/ contains the preserved ESM module and Less source exports.
  • lib/ contains CommonJS output.
  • dist/ contains the UMD entry and CSS files.

The package is built with @composy/builder and rolldown. exports, main, module, types, unpkg, and jsdelivr map to these outputs.

Development checks

From the workspace root, run pnpm run build, pnpm run type-check, and pnpm run lint:check. The ESM and CJS type configurations are stored under packages/vue/.ldesign/.

License

MIT

Controlled message updates

When messages is provided, the component synchronizes it as a controlled snapshot: removed IDs are removed from the Core store, existing IDs are upserted, and new IDs are added in input order. Keep IDs stable across refreshes to avoid visual reordering and to preserve read state decisions in the host application.

The component creates the Core instance inside its mounted container. Core rendering and style injection follow that container's owner document, which also supports iframe and detached-document hosts. The parent application still needs to provide the shared --ld-* Color and Size variables.

Related Packages

@dullar/mercury

Advanced and highly reusable Mobile UI Components built on Vue2 & You can define...

8,553 6
@halobear/vue-upload

vue上传组件

460 1
vite-plugin-vue2

Vite plugin for Vue2

1,474,659 618
vue-jstree

a tree plugin for vue2

137,015 630
vite-plugin-git-revision

Vite plugin that generates VERSION and COMMITHASH files during build based on a...

21,961 11

Version History

Version Released Vue License
0.0.2 3.5.32 MIT
0.0.1 ^2.7.0 || ^3.5.32 MIT