@ruixinkeji/prism-ui 1.0.10 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -13,22 +13,74 @@
13
13
  ## 安装
14
14
 
15
15
  ```bash
16
- npm install @ruixinkeji/prism-ui
16
+ npm install @ruixinkeji/prism-ui pinia
17
17
  ```
18
18
 
19
- ## 使用
19
+ ## 快速开始
20
20
 
21
- ```scss
22
- // main.js 或 App.vue
23
- @import "@/styles/index.scss";
21
+ ### 1. 初始化 Pinia
22
+
23
+ ```ts
24
+ // main.ts
25
+ import { createSSRApp } from 'vue'
26
+ import { createPinia } from 'pinia'
27
+ import App from './App.vue'
28
+
29
+ export function createApp() {
30
+ const app = createSSRApp(App)
31
+ app.use(createPinia())
32
+ return { app }
33
+ }
24
34
  ```
25
35
 
26
- ## 深色模式
36
+ ### 2. 引入样式
27
37
 
28
38
  ```vue
29
- <view :class="{ 'dark-mode': isDark }">
30
- <!-- 内容自动适配深色模式 -->
31
- </view>
39
+ <!-- App.vue -->
40
+ <style lang="scss">
41
+ @import '@ruixinkeji/prism-ui/styles/index.scss';
42
+ @import '@ruixinkeji/prism-ui/fonts/font-awesome.css';
43
+ </style>
44
+ ```
45
+
46
+ ### 3. 配置 easycom(可选)
47
+
48
+ 在 `pages.json` 中添加:
49
+
50
+ ```json
51
+ {
52
+ "easycom": {
53
+ "custom": {
54
+ "^Prism(.*)": "@ruixinkeji/prism-ui/components/Prism$1/Prism$1.vue"
55
+ }
56
+ }
57
+ }
58
+ ```
59
+
60
+ 配置后可直接使用组件,无需 import:
61
+
62
+ ```vue
63
+ <template>
64
+ <PrismNavBar title="首页" />
65
+ <PrismTabBar :tabs="tabs" />
66
+ </template>
67
+ ```
68
+
69
+ ### 4. 手动引入组件
70
+
71
+ ```vue
72
+ <script setup>
73
+ import PrismNavBar from '@ruixinkeji/prism-ui/components/PrismNavBar/PrismNavBar.vue'
74
+ import { useAppStore } from '@ruixinkeji/prism-ui/store/app'
75
+
76
+ const appStore = useAppStore()
77
+ </script>
78
+
79
+ <template>
80
+ <view :class="{ 'dark-mode': appStore.isDarkMode }">
81
+ <PrismNavBar title="首页" />
82
+ </view>
83
+ </template>
32
84
  ```
33
85
 
34
86
  ## 组件
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Prism UI - 组件类型定义
3
+ */
4
+ import { DefineComponent } from 'vue'
5
+
6
+ // 导航栏组件
7
+ export declare const PrismNavBar: DefineComponent<{
8
+ title: string
9
+ icon?: string
10
+ iconColor?: string
11
+ glass?: boolean
12
+ showBack?: boolean
13
+ }>
14
+
15
+ // 底部导航组件
16
+ export declare const PrismTabBar: DefineComponent<{
17
+ current: string
18
+ glass?: boolean
19
+ tabs?: Array<{ path: string; text: string; icon: string }>
20
+ }>
21
+
22
+ // 开关组件
23
+ export declare const PrismSwitch: DefineComponent<{
24
+ modelValue: boolean
25
+ onText?: string
26
+ offText?: string
27
+ showText?: boolean
28
+ square?: boolean
29
+ disabled?: boolean
30
+ }>
31
+
32
+ // 验证码输入
33
+ export declare const PrismCodeInput: DefineComponent<{
34
+ modelValue: string
35
+ length?: number
36
+ }>
37
+
38
+ // 安全密码输入
39
+ export declare const PrismSecureInput: DefineComponent<{
40
+ modelValue: string
41
+ length?: number
42
+ title?: string
43
+ randomOrder?: boolean
44
+ }>
45
+
46
+ // 日期时间选择器
47
+ export declare const PrismDateTimePicker: DefineComponent<{
48
+ modelValue: string | number | Date
49
+ mode?: 'picker' | 'calendar'
50
+ showTime?: boolean
51
+ placeholder?: string
52
+ }>
53
+
54
+ // 城市选择器
55
+ export declare const PrismCityPicker: DefineComponent<{
56
+ modelValue: Array<{ code: string; name: string }>
57
+ mode?: 'picker' | 'cascade'
58
+ level?: number
59
+ placeholder?: string
60
+ }>
61
+
62
+ // 图片选择器
63
+ export declare const PrismImagePicker: DefineComponent<{
64
+ modelValue: string
65
+ defaultImages?: string[]
66
+ uploadText?: string
67
+ disabled?: boolean
68
+ }>
69
+
70
+ // 身份证输入
71
+ export declare const PrismIdCardInput: DefineComponent<{
72
+ modelValue: string
73
+ showInfo?: boolean
74
+ placeholder?: string
75
+ }>
76
+
77
+ // 车牌号输入
78
+ export declare const PrismLicensePlateInput: DefineComponent<{
79
+ modelValue: string
80
+ }>
package/easycom.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "easycom": {
3
+ "autoscan": false,
4
+ "custom": {
5
+ "^Prism(.*)": "@ruixinkeji/prism-ui/components/Prism$1/Prism$1.vue"
6
+ }
7
+ }
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ruixinkeji/prism-ui",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "description": "Prism UI - 现代化玻璃态设计 uni-app 组件库",
5
5
  "main": "index.js",
6
6
  "module": "index.esm.js",
@@ -12,6 +12,8 @@
12
12
  "fonts",
13
13
  "store",
14
14
  "utils",
15
+ "easycom.json",
16
+ "components.d.ts",
15
17
  "index.js",
16
18
  "index.esm.js",
17
19
  "index.d.ts",