@xjw_/vue2-npm-system 1.0.0

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 ADDED
@@ -0,0 +1,256 @@
1
+ # JC Vue Components
2
+
3
+ 基于 Element-UI 的 Vue2 组件库,二次封装常用组件,提供更丰富的业务功能。
4
+
5
+ ## 版本信息
6
+
7
+ - Vue: 2.6.10
8
+ - Element-UI: 2.13.2
9
+ - VXE-Table: ^3.2.20
10
+
11
+ ## 安装
12
+
13
+ ```bash
14
+ npm install jc-vue-components
15
+ ```
16
+
17
+ ## 快速开始
18
+
19
+ ### 全局注册
20
+
21
+ ```javascript
22
+ import Vue from 'vue'
23
+ import ElementUI from 'element-ui'
24
+ import JcComponents from 'jc-vue-components'
25
+ import 'jc-vue-components/dist/jc-vue-components.css'
26
+
27
+ Vue.use(ElementUI)
28
+ Vue.use(JcComponents)
29
+ ```
30
+
31
+ ### 按需引入
32
+
33
+ ```javascript
34
+ import Vue from 'vue'
35
+ import { JcButton, JcInput, JcTable } from 'jc-vue-components'
36
+
37
+ Vue.component('JcButton', JcButton)
38
+ Vue.component('JcInput', JcInput)
39
+ Vue.component('JcTable', JcTable)
40
+ ```
41
+
42
+ ## 组件列表
43
+
44
+ ### JcButton 按钮
45
+
46
+ 增强的按钮组件,支持防抖、加载状态等功能。
47
+
48
+ ```vue
49
+ <template>
50
+ <jc-button
51
+ jc-type="primary"
52
+ :debounce="1000"
53
+ :loading="loading"
54
+ @click="handleClick"
55
+ >
56
+ 点击我
57
+ </jc-button>
58
+ </template>
59
+ ```
60
+
61
+ **Props:**
62
+ - `jc-type`: 按钮类型 (default: 'primary')
63
+ - `size`: 尺寸 (default: 'medium')
64
+ - `disabled`: 是否禁用 (default: false)
65
+ - `loading`: 是否加载中 (default: false)
66
+ - `debounce`: 防抖时间(毫秒)(default: 0)
67
+
68
+ **Events:**
69
+ - `click`: 点击事件
70
+
71
+ ### JcInput 输入框
72
+
73
+ 增强的输入框组件,支持字数统计、密码显示等功能。
74
+
75
+ ```vue
76
+ <template>
77
+ <jc-input
78
+ v-model="value"
79
+ type="password"
80
+ show-password
81
+ show-count
82
+ :maxlength="100"
83
+ placeholder="请输入"
84
+ />
85
+ </template>
86
+ ```
87
+
88
+ **Props:**
89
+ - `value`: 绑定值
90
+ - `type`: 输入框类型 (default: 'text')
91
+ - `size`: 尺寸 (default: 'medium')
92
+ - `disabled`: 是否禁用 (default: false)
93
+ - `clearable`: 是否可清空 (default: true)
94
+ - `showPassword`: 显示切换密码图标 (default: false)
95
+ - `maxlength`: 最大长度
96
+ - `showCount`: 显示字数统计 (default: false)
97
+
98
+ **Events:**
99
+ - `input`: 输入事件
100
+ - `change`: 改变事件
101
+ - `blur`: 失焦事件
102
+ - `focus`: 聚焦事件
103
+
104
+ ### JcDialog 对话框
105
+
106
+ 增强的对话框组件,内置确认/取消按钮。
107
+
108
+ ```vue
109
+ <template>
110
+ <jc-dialog
111
+ :visible.sync="dialogVisible"
112
+ title="标题"
113
+ width="50%"
114
+ @confirm="handleConfirm"
115
+ @cancel="handleCancel"
116
+ >
117
+ <p>对话框内容</p>
118
+ </jc-dialog>
119
+ </template>
120
+ ```
121
+
122
+ **Props:**
123
+ - `visible`: 是否显示 (default: false)
124
+ - `title`: 标题
125
+ - `width`: 宽度 (default: '50%')
126
+ - `showFooter`: 显示底部 (default: true)
127
+ - `showCancelButton`: 显示取消按钮 (default: true)
128
+ - `showConfirmButton`: 显示确认按钮 (default: true)
129
+ - `confirmLoading`: 确认按钮加载中 (default: false)
130
+
131
+ **Events:**
132
+ - `open`: 打开事件
133
+ - `close`: 关闭事件
134
+ - `confirm`: 确认事件
135
+ - `cancel`: 取消事件
136
+
137
+ ### JcSelect 选择器
138
+
139
+ 增强的选择器组件,支持数据配置和多选。
140
+
141
+ ```vue
142
+ <template>
143
+ <jc-select
144
+ v-model="value"
145
+ :options="options"
146
+ multiple
147
+ filterable
148
+ placeholder="请选择"
149
+ />
150
+ </template>
151
+
152
+ <script>
153
+ export default {
154
+ data() {
155
+ return {
156
+ value: '',
157
+ options: [
158
+ { value: '1', label: '选项一' },
159
+ { value: '2', label: '选项二' }
160
+ ]
161
+ }
162
+ }
163
+ }
164
+ </script>
165
+ ```
166
+
167
+ **Props:**
168
+ - `value`: 绑定值
169
+ - `options`: 选项数组
170
+ - `multiple`: 是否多选 (default: false)
171
+ - `filterable`: 是否可搜索 (default: false)
172
+ - `valueKey`: 值字段名 (default: 'value')
173
+ - `labelKey`: 标签字段名 (default: 'label')
174
+
175
+ **Events:**
176
+ - `change`: 改变事件
177
+ - `visible-change`: 显示/隐藏事件
178
+
179
+ ### JcTable 表格
180
+
181
+ 增强的表格组件,支持动态列配置和分页。
182
+
183
+ ```vue
184
+ <template>
185
+ <jc-table
186
+ :data="tableData"
187
+ :columns="columns"
188
+ :show-index="true"
189
+ :show-selection="true"
190
+ :show-pagination="true"
191
+ :total="100"
192
+ @selection-change="handleSelectionChange"
193
+ >
194
+ <template slot="operation" slot-scope="{ row }">
195
+ <jc-button @click="handleEdit(row)">编辑</jc-button>
196
+ </template>
197
+ </jc-table>
198
+ </template>
199
+
200
+ <script>
201
+ export default {
202
+ data() {
203
+ return {
204
+ tableData: [],
205
+ columns: [
206
+ { prop: 'name', label: '姓名', minWidth: 100 },
207
+ { prop: 'age', label: '年龄', width: 80 }
208
+ ]
209
+ }
210
+ }
211
+ }
212
+ </script>
213
+ ```
214
+
215
+ **Props:**
216
+ - `data`: 表格数据
217
+ - `columns`: 列配置
218
+ - `size`: 尺寸 (default: 'medium')
219
+ - `border`: 边框 (default: true)
220
+ - `showIndex`: 显示序号 (default: false)
221
+ - `showSelection`: 显示选择列 (default: false)
222
+ - `showOperation`: 显示操作列 (default: false)
223
+ - `showPagination`: 显示分页 (default: false)
224
+
225
+ **Events:**
226
+ - `selection-change`: 选择变化事件
227
+ - `sort-change`: 排序变化事件
228
+ - `size-change`: 每页条数变化事件
229
+ - `current-change-page`: 页码变化事件
230
+
231
+ ## 本地开发
232
+
233
+ ```bash
234
+ # 安装依赖
235
+ npm install
236
+
237
+ # 开发模式
238
+ npm run dev
239
+
240
+ # 构建
241
+ npm run build
242
+ ```
243
+
244
+ ## 发布到 npm
245
+
246
+ ```bash
247
+ # 修改版本号
248
+ npm version patch # 或 minor/major
249
+
250
+ # 发布
251
+ npm publish
252
+ ```
253
+
254
+ ## License
255
+
256
+ MIT
@@ -0,0 +1 @@
1
+ <!doctype html><html lang="zh-CN"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>JC Vue Components - 组件库演示</title></head><body><div id="app"></div><script src="jc-vue-components.js"></script></body></html>