@cyning/cy-vue2-ui

基于 Vue 2 的轻量级组件库,适用于 uni-app
1,530
Install
npm install @cyning/cy-vue2-ui
Latest Version:0.0.51
Vue:2
License:MIT
Last Updated:Jul 11, 2025
Links: npm
Maintainer: cyning

cyning-vue2-ui

🎨 一个基于 Vue 2 的 UI 组件库,目前主要面向微信小程序开发场景,也适用于其他移动端项目。

⚠️ 当前仍在开发中,接口可能会频繁变更,请谨慎用于生产环境。


✨ 特性

  • ✅ 支持 Vue 2.x
  • ✅ 支持微信小程序(通过 uni-app 或原生绑定)
  • ✅ 内置多个基础组件(Button、Modal 等)

📦 安装

yarn add @cyning/cyning-vue2-ui
# 或
npm install @cyning/cyning-vue2-ui --save

🔐 加密解密功能

配置

在项目初始化时配置加密解密参数:

import CyUI from '@cyning/cyning-vue2-ui'

Vue.use(CyUI, {
  // 加密解密配置
  cryptoConfig: {
    encryptType: 'aes', // 加密类型:'aes' | 'rsa' | 'hybrid'
    aesKey: 'your-aes-key', // AES密钥
    randomChars: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' // 随机字符集
  },
  rsaConfig: {
    publicKey: 'your-rsa-public-key', // RSA公钥
    privateKey: 'your-rsa-private-key' // RSA私钥
  }
})

使用方法

1. 在请求中使用加密
import { post } from '@cyning/cyning-vue2-ui'

// 启用加密
post('/api/login', userData, {
  encrypt: true, // 启用加密
  encryptType: 'aes', // 可选:指定加密类型
  decrypt: true // 启用解密
})
2. 手动加密解密
import { 
  encryptWithAes, 
  decryptWithAes, 
  rsaEncrypt, 
  rsaDecrypt, 
  generateAesKey 
} from '@cyning/cyning-vue2-ui'

// AES加密
const aesKey = generateAesKey()
const encrypted = encryptWithAes('hello world', aesKey)
const decrypted = decryptWithAes(encrypted, aesKey)

// RSA加密
const rsaEncrypted = rsaEncrypt('hello world')
const rsaDecrypted = rsaDecrypt(rsaEncrypted)
3. 加密类型说明
  • aes: 使用AES对称加密
  • rsa: 使用RSA非对称加密
  • hybrid: 混合加密(RSA加密AES密钥,AES加密数据)

配置项说明

配置项 类型 默认值 说明
cryptoConfig.encryptType string 'aes' 默认加密类型
cryptoConfig.aesKey string - AES密钥
cryptoConfig.randomChars string 默认字符集 随机字符集
rsaConfig.publicKey string - RSA公钥
rsaConfig.privateKey string - RSA私钥

请求参数说明

参数 类型 默认值 说明
encrypt boolean false 是否启用加密
decrypt boolean false 是否启用解密
encryptType string 配置的默认值 加密类型
publicKey string 配置的默认值 RSA公钥
aesKey string 配置的默认值 AES密钥

Related Packages

papa-mp-vue2

小程序可视化页面组件库

7,526
misp-ui-library-test

基于Vue2的轻量级UI组件库,提供丰富的可复用组件。

3,039
uni-press-ui

A material like components library for vue2

945
@alanlee97/lee-ui

基于 Vue 3 的轻量级 UI 组件库

909
yan-vue

A Vue2 component library

693

Version History

Version Released Vue License
0.0.51 ^2.6.0 MIT
0.0.50 ^2.6.0 MIT
0.0.49 ^2.6.0 MIT
0.0.48 ^2.6.0 MIT
0.0.47 ^2.6.0 MIT
Pre-releases (1)
Version Released Vue License
0.0.23-yar ^2.6.0 MIT