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

sccba-ui

v0.0.22

Published

一个基于 Vue 2/3 的 UI 组件库,使用 vue-demi 实现跨版本兼容

Readme

sccba-ui

一个基于 Vue 2/3 的 UI 组件库,使用 vue-demi 实现跨版本兼容。

特性

  • 支持 Vue 2.7 和 Vue 3.x
  • 基于 Element UI 和 Element Plus 构建
  • 提供 SccbaButton 和 SccbaInput 组件
  • 使用 TypeScript 友好的 API 设计

安装

npm install sccba-ui

使用

Vue 3

完整引入(推荐)

重要:Vue 3项目必须先安装 element-plus

npm install element-plus
import { createApp } from 'vue'
import SccbaUI from 'sccba-ui'
import 'sccba-ui/dist/sccba-ui.css'
import App from './App.vue'

const app = createApp(App)
app.use(SccbaUI)
app.mount('#app')

按需引入

重要:Vue 3项目必须先安装 element-plus

npm install element-plus
import { createApp } from 'vue'
import { SccbaButton, SccbaInput } from 'sccba-ui'
import 'sccba-ui/dist/sccba-ui.css'
import App from './App.vue'

const app = createApp(App)
app.use(SccbaButton)
app.use(SccbaInput)
app.mount('#app')

Vue 2

完整引入(推荐)

重要:Vue 2项目必须先安装 element-ui

npm install element-ui
import Vue from 'vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

// 使用 CommonJS 方式引入 sccba-ui
const SccbaUI = require('sccba-ui')
import 'sccba-ui/dist/sccba-ui.css'
import App from './App.vue'

Vue.use(ElementUI)
Vue.use(SccbaUI)

new Vue({
  render: h => h(App)
}).$mount('#app')

按需引入

重要:Vue 2项目必须先安装 element-ui

npm install element-ui
import Vue from 'vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

// 使用 CommonJS 方式按需引入组件
// 注意:使用对象属性访问,而不是解构赋值
const SccbaUI = require('sccba-ui')
const SccbaButton = SccbaUI.SccbaButton
const SccbaInput = SccbaUI.SccbaInput
import 'sccba-ui/dist/sccba-ui.css'
import App from './App.vue'

Vue.use(ElementUI)
Vue.use(SccbaButton)
Vue.use(SccbaInput)

new Vue({
  render: h => h(App)
}).$mount('#app')

注意

  • 不要使用解构赋值:const { SccbaButton, SccbaInput } = require('sccba-ui')
  • 老旧webpack可能不支持解构赋值,请使用对象属性访问方式

组件

SccbaButton

按钮组件,支持多种类型和样式。

Props

  • type: 按钮类型,可选值:primarysuccesswarningdangerinfo
  • size: 按钮尺寸,可选值:largemediumsmall
  • plain: 是否为朴素按钮
  • round: 是否为圆角按钮
  • circle: 是否为圆形按钮
  • disabled: 是否禁用

示例

<template>
  <sccba-button type="primary">主要按钮</sccba-button>
  <sccba-button type="success">成功按钮</sccba-button>
  <sccba-button type="danger">危险按钮</sccba-button>
</template>

SccbaInput

输入框组件,支持多种输入类型。

Props

  • type: 输入框类型,默认为 text
  • placeholder: 占位符文本
  • disabled: 是否禁用
  • readonly: 是否只读
  • clearable: 是否可清空
  • showPassword: 是否显示密码切换按钮
  • maxlength: 最大输入长度
  • showWordLimit: 是否显示字数统计

方法

  • focus(): 聚焦输入框

示例

<template>
  <sccba-input ref="inputRef" placeholder="请输入内容" />
  <sccba-button @click="inputRef.focus()">聚焦输入框</sccba-button>
</template>

<script setup>
import { ref } from 'vue'
const inputRef = ref(null)
</script>

依赖

  • vue: ^2.7.0 || ^3.0.0
  • vue-demi: ^0.14.10
  • element-ui: ^2.15.14 (Vue 2项目需要单独安装)
  • element-plus: ^2.13.0 (Vue 3项目需要单独安装)

注意:sccba-ui 不直接包含 element-ui 和 element-plus,使用时需要根据Vue版本单独安装对应的UI库。

开发

# 安装依赖
npm install

# 开发模式
npm run dev

# 构建
npm run build

# 切换 Vue 版本
npm run switch:vue2  # 切换到 Vue 2
npm run switch:vue3  # 切换到 Vue 3

License

MIT