npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

setting-center-core

v1.0.0

Published

Setting Center Core System - Complete pages and functionality for organizational management

Readme

@setting-center/core

设置中心核心包,提供完整的组织管理页面和功能。

安装

npm install @setting-center/core
# 或
yarn add @setting-center/core
# 或
pnpm add @setting-center/core

依赖项

确保您的项目中已安装以下依赖:

npm install vue@>=3.3.0 vue-router@>=4.2.0 pinia@>=2.1.0 vue-i18n@>=9.2.0 vuetify@>=3.5.0 @casl/ability@>=6.0.0 @iconify/vue@>=4.0.0

使用方法

1. 作为插件使用

import { createApp } from 'vue'
import { createRouter, createWebHistory } from 'vue-router'
import { createPinia } from 'pinia'
import { createI18n } from 'vue-i18n'
import { createSettingCenter } from '@setting-center/core'

const app = createApp(App)
const router = createRouter({ history: createWebHistory(), routes: [] })
const pinia = createPinia()
const i18n = createI18n({ locale: 'zh-CN', messages: {} })

// 安装设置中心插件
app.use(createSettingCenter({
  basePath: '/setting-center', // 基础路由路径,可选,默认为'/setting-center'
  router,
  pinia,
  i18n,
  apiBaseURL: 'https://api.example.com', // API基础URL,可选
  getAuthToken: () => localStorage.getItem('token'), // 获取认证token的函数,可选
  onAuthError: (code) => console.error('认证错误:', code) // 认证错误处理函数,可选
}))

app.use(router)
app.use(pinia)
app.use(i18n)
app.mount('#app')

2. 仅使用路由

import { createRouter, createWebHistory } from 'vue-router'
import { settingCenterRoutes } from '@setting-center/core/routes'

const router = createRouter({
  history: createWebHistory(),
  routes: [
    // 其他路由
    ...settingCenterRoutes
  ]
})

或者自定义路由路径:

import { createRouter, createWebHistory } from 'vue-router'
import { createSettingCenterRoutes } from '@setting-center/core'

const router = createRouter({
  history: createWebHistory(),
  routes: [
    // 其他路由
    createSettingCenterRoutes('/custom-path')
  ]
})

3. 引入样式

// 在入口文件中引入样式
import '@setting-center/core/styles'

主要功能

  • 组织管理
  • 角色权限管理
  • 系统设置
  • 用户管理

配置选项

| 选项 | 类型 | 描述 | 是否必需 | |------|------|------|----------| | basePath | string | 基础路由路径 | 否,默认'/setting-center' | | apiBaseURL | string | API基础URL | 否 | | getAuthToken | function | 获取认证token的函数 | 否 | | router | VueRouter | Vue Router实例 | 否 | | pinia | Pinia | Pinia实例 | 否 | | i18n | VueI18n | Vue I18n实例 | 否 | | onAuthError | function | 认证错误处理函数 | 否 |

多语言支持

设置中心默认支持中英文两种语言:

  • 中文 (zh-CN)
  • 英文 (en)

多语言文件会自动合并到您的Vue I18n实例中。

开发

# 进入目录
cd packages/core

# 安装依赖
pnpm install

# 构建包
pnpm run build

许可证

MIT