jianghu-ui 1.0.1
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 +376 -0
- package/dist/jianghu-ui.css +2318 -0
- package/dist/jianghu-ui.js +2 -0
- package/dist/jianghu-ui.js.LICENSE.txt +1 -0
- package/package.json +56 -0
- package/src/Design.stories.mdx +195 -0
- package/src/Introduction.stories.mdx +148 -0
- package/src/components/JhAddressSelect/JhAddressSelect.md +250 -0
- package/src/components/JhAddressSelect/JhAddressSelect.stories.js +282 -0
- package/src/components/JhAddressSelect/JhAddressSelect.vue +261 -0
- package/src/components/JhCard/JhCard.md +246 -0
- package/src/components/JhCard/JhCard.stories.js +688 -0
- package/src/components/JhCard/JhCard.vue +604 -0
- package/src/components/JhCheckCard/JhCheckCard.md +245 -0
- package/src/components/JhCheckCard/JhCheckCard.stories.js +750 -0
- package/src/components/JhCheckCard/JhCheckCard.vue +476 -0
- package/src/components/JhConfirmDialog/JhConfirmDialog.md +70 -0
- package/src/components/JhConfirmDialog/JhConfirmDialog.stories.js +550 -0
- package/src/components/JhConfirmDialog/JhConfirmDialog.vue +181 -0
- package/src/components/JhDateRangePicker/JhDateRangePicker.md +56 -0
- package/src/components/JhDateRangePicker/JhDateRangePicker.stories.js +320 -0
- package/src/components/JhDateRangePicker/JhDateRangePicker.vue +307 -0
- package/src/components/JhDescriptions/JhDescriptions.md +724 -0
- package/src/components/JhDescriptions/JhDescriptions.stories.js +858 -0
- package/src/components/JhDescriptions/JhDescriptions.vue +933 -0
- package/src/components/JhDraggable/JhDraggable.md +66 -0
- package/src/components/JhDraggable/JhDraggable.stories.js +161 -0
- package/src/components/JhDraggable/JhDraggable.vue +254 -0
- package/src/components/JhDrawer/JhDrawer.md +68 -0
- package/src/components/JhDrawer/JhDrawer.stories.js +478 -0
- package/src/components/JhDrawer/JhDrawer.vue +281 -0
- package/src/components/JhDrawerForm/JhDrawerForm.md +69 -0
- package/src/components/JhDrawerForm/JhDrawerForm.stories.js +492 -0
- package/src/components/JhDrawerForm/JhDrawerForm.vue +297 -0
- package/src/components/JhEditableTable/JhEditableTable.md +507 -0
- package/src/components/JhEditableTable/JhEditableTable.stories.js +615 -0
- package/src/components/JhEditableTable/JhEditableTable.vue +685 -0
- package/src/components/JhFileInput/JhFileInput.md +56 -0
- package/src/components/JhFileInput/JhFileInput.stories.js +103 -0
- package/src/components/JhFileInput/JhFileInput.vue +253 -0
- package/src/components/JhForm/JhForm.md +676 -0
- package/src/components/JhForm/JhForm.stories.js +1375 -0
- package/src/components/JhForm/JhForm.vue +657 -0
- package/src/components/JhFormField/JhFormField.stories.js +217 -0
- package/src/components/JhFormField/JhFormField.vue +439 -0
- package/src/components/JhFormFields/JhFormFields.md +647 -0
- package/src/components/JhFormFields/JhFormFields.stories.js +922 -0
- package/src/components/JhFormFields/JhFormFields.vue +998 -0
- package/src/components/JhFormList/JhFormList.md +303 -0
- package/src/components/JhFormList/JhFormList.stories.js +661 -0
- package/src/components/JhFormList/JhFormList.vue +1127 -0
- package/src/components/JhJsonEditor/JhJsonEditor.md +54 -0
- package/src/components/JhJsonEditor/JhJsonEditor.stories.js +157 -0
- package/src/components/JhJsonEditor/JhJsonEditor.vue +178 -0
- package/src/components/JhLayout/JhLayout.md +580 -0
- package/src/components/JhLayout/JhLayout.stories.js +414 -0
- package/src/components/JhLayout/JhLayout.vue +387 -0
- package/src/components/JhList/JhList.md +441 -0
- package/src/components/JhList/JhList.stories.js +524 -0
- package/src/components/JhList/JhList.vue +571 -0
- package/src/components/JhMarkdownEditor/JhMarkdownEditor.md +56 -0
- package/src/components/JhMarkdownEditor/JhMarkdownEditor.stories.js +191 -0
- package/src/components/JhMarkdownEditor/JhMarkdownEditor.vue +188 -0
- package/src/components/JhMask/JhMask.md +62 -0
- package/src/components/JhMask/JhMask.stories.js +270 -0
- package/src/components/JhMask/JhMask.vue +123 -0
- package/src/components/JhMenu/JhMenu.md +85 -0
- package/src/components/JhMenu/JhMenu.stories.js +384 -0
- package/src/components/JhMenu/JhMenu.vue +545 -0
- package/src/components/JhModal/JhModal.md +68 -0
- package/src/components/JhModal/JhModal.stories.js +562 -0
- package/src/components/JhModal/JhModal.vue +235 -0
- package/src/components/JhModalForm/JhModalForm.md +69 -0
- package/src/components/JhModalForm/JhModalForm.stories.js +592 -0
- package/src/components/JhModalForm/JhModalForm.vue +298 -0
- package/src/components/JhPageContainer/JhPageContainer.md +409 -0
- package/src/components/JhPageContainer/JhPageContainer.stories.js +209 -0
- package/src/components/JhPageContainer/JhPageContainer.vue +72 -0
- package/src/components/JhQueryFilter/JhQueryFilter.md +77 -0
- package/src/components/JhQueryFilter/JhQueryFilter.stories.js +684 -0
- package/src/components/JhQueryFilter/JhQueryFilter.vue +429 -0
- package/src/components/JhScene/JhScene.md +64 -0
- package/src/components/JhScene/JhScene.stories.js +317 -0
- package/src/components/JhScene/JhScene.vue +376 -0
- package/src/components/JhStatisticCard/JhStatisticCard.md +363 -0
- package/src/components/JhStatisticCard/JhStatisticCard.stories.js +847 -0
- package/src/components/JhStatisticCard/JhStatisticCard.vue +459 -0
- package/src/components/JhStepsForm/JhStepsForm.md +666 -0
- package/src/components/JhStepsForm/JhStepsForm.stories.js +1224 -0
- package/src/components/JhStepsForm/JhStepsForm.vue +749 -0
- package/src/components/JhTable/JhTable.md +730 -0
- package/src/components/JhTable/JhTable.stories.js +1444 -0
- package/src/components/JhTable/JhTable.vue +2298 -0
- package/src/components/JhTableAttachment/JhTableAttachment.md +70 -0
- package/src/components/JhTableAttachment/JhTableAttachment.stories.js +198 -0
- package/src/components/JhTableAttachment/JhTableAttachment.vue +264 -0
- package/src/components/JhToast/JhToast.md +67 -0
- package/src/components/JhToast/JhToast.stories.js +386 -0
- package/src/components/JhToast/JhToast.vue +239 -0
- package/src/components/JhTreeSelect/JhTreeSelect.md +82 -0
- package/src/components/JhTreeSelect/JhTreeSelect.stories.js +391 -0
- package/src/components/JhTreeSelect/JhTreeSelect.vue +727 -0
- package/src/components/JhWaterMark/JhWaterMark.md +190 -0
- package/src/components/JhWaterMark/JhWaterMark.stories.js +675 -0
- package/src/components/JhWaterMark/JhWaterMark.vue +351 -0
- package/src/components/README.md +52 -0
- package/src/index.js +135 -0
- package/src/style/globalCSSJHV4.css +348 -0
- package/src/style/globalCSSVuetifyV4.css +637 -0
- package/src/style/storybook.css +4 -0
- package/src/tailwind.css +3 -0
- package/src/utils/vuetify.js +31 -0
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
import JhDrawer from './JhDrawer.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: '基础组件/JhDrawer - 抽屉',
|
|
5
|
+
component: JhDrawer,
|
|
6
|
+
parameters: {
|
|
7
|
+
docs: {
|
|
8
|
+
description: {
|
|
9
|
+
component: `
|
|
10
|
+
# JhDrawer 通用抽屉组件
|
|
11
|
+
|
|
12
|
+
基于 Vuetify 的通用抽屉组件,提供一致的抽屉框架,支持完全自定义内容。
|
|
13
|
+
|
|
14
|
+
## 特性
|
|
15
|
+
|
|
16
|
+
- 🎨 **自定义内容**: 通过默认插槽完全自定义抽屉内容
|
|
17
|
+
- 📐 **多方向弹出**: 支持左/右及移动端常见的底部弹出
|
|
18
|
+
- 🎛️ **灵活配置**: 支持左右位置、宽度、按钮显示等配置
|
|
19
|
+
- 🔧 **操作按钮**: 支持自定义操作按钮或使用默认按钮
|
|
20
|
+
- 📱 **响应式**: 适配移动端和桌面端
|
|
21
|
+
- 🎯 **事件丰富**: 提供 open、close、confirm、cancel 等事件
|
|
22
|
+
|
|
23
|
+
## 基础用法
|
|
24
|
+
|
|
25
|
+
\`\`\`vue
|
|
26
|
+
<jh-drawer v-model="showDrawer" title="自定义抽屉">
|
|
27
|
+
<div>这里是自定义内容</div>
|
|
28
|
+
</jh-drawer>
|
|
29
|
+
\`\`\`
|
|
30
|
+
|
|
31
|
+
## Props
|
|
32
|
+
|
|
33
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
34
|
+
|------|------|------|--------|
|
|
35
|
+
| value | 抽屉显示状态 (v-model) | Boolean | false |
|
|
36
|
+
| title | 抽屉标题 | String | '抽屉' |
|
|
37
|
+
| position | 抽屉位置 (left/right/bottom) | String | 'right' |
|
|
38
|
+
| width | 抽屉宽度 | String/Number | '90%' |
|
|
39
|
+
| height | 底部抽屉高度 | String/Number | '60vh' |
|
|
40
|
+
| showConfirmButton | 是否显示确认按钮 | Boolean | true |
|
|
41
|
+
| showCancelButton | 是否显示取消按钮 | Boolean | true |
|
|
42
|
+
| showCloseButton | 是否显示浮动关闭按钮 | Boolean | true |
|
|
43
|
+
| confirmText | 确认按钮文本 | String | '确认' |
|
|
44
|
+
| cancelText | 取消按钮文本 | String | '取消' |
|
|
45
|
+
|
|
46
|
+
## Events
|
|
47
|
+
|
|
48
|
+
| 事件名 | 说明 | 参数 |
|
|
49
|
+
|--------|------|------|
|
|
50
|
+
| open | 抽屉打开时触发 | - |
|
|
51
|
+
| close | 抽屉关闭时触发 | - |
|
|
52
|
+
| confirm | 点击确认按钮时触发 | - |
|
|
53
|
+
| cancel | 点击取消按钮时触发 | - |
|
|
54
|
+
|
|
55
|
+
## Slots
|
|
56
|
+
|
|
57
|
+
| 插槽名 | 说明 |
|
|
58
|
+
|--------|------|
|
|
59
|
+
| default | 抽屉内容 |
|
|
60
|
+
| actions | 自定义操作按钮 |
|
|
61
|
+
|
|
62
|
+
## 方法
|
|
63
|
+
|
|
64
|
+
| 方法名 | 说明 | 参数 |
|
|
65
|
+
|--------|------|------|
|
|
66
|
+
| open | 打开抽屉 | - |
|
|
67
|
+
| close | 关闭抽屉 | - |
|
|
68
|
+
`
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
argTypes: {
|
|
73
|
+
value: {
|
|
74
|
+
control: { type: 'boolean' },
|
|
75
|
+
description: '抽屉显示状态'
|
|
76
|
+
},
|
|
77
|
+
title: {
|
|
78
|
+
control: { type: 'text' },
|
|
79
|
+
description: '抽屉标题'
|
|
80
|
+
},
|
|
81
|
+
position: {
|
|
82
|
+
control: { type: 'select' },
|
|
83
|
+
options: ['left', 'right', 'bottom'],
|
|
84
|
+
description: '抽屉位置'
|
|
85
|
+
},
|
|
86
|
+
width: {
|
|
87
|
+
control: { type: 'text' },
|
|
88
|
+
description: '抽屉宽度'
|
|
89
|
+
},
|
|
90
|
+
height: {
|
|
91
|
+
control: { type: 'text' },
|
|
92
|
+
description: '底部抽屉高度'
|
|
93
|
+
},
|
|
94
|
+
showConfirmButton: {
|
|
95
|
+
control: { type: 'boolean' },
|
|
96
|
+
description: '是否显示确认按钮'
|
|
97
|
+
},
|
|
98
|
+
showCancelButton: {
|
|
99
|
+
control: { type: 'boolean' },
|
|
100
|
+
description: '是否显示取消按钮'
|
|
101
|
+
},
|
|
102
|
+
showCloseButton: {
|
|
103
|
+
control: { type: 'boolean' },
|
|
104
|
+
description: '是否显示浮动关闭按钮'
|
|
105
|
+
},
|
|
106
|
+
confirmText: {
|
|
107
|
+
control: { type: 'text' },
|
|
108
|
+
description: '确认按钮文本'
|
|
109
|
+
},
|
|
110
|
+
cancelText: {
|
|
111
|
+
control: { type: 'text' },
|
|
112
|
+
description: '取消按钮文本'
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
// 基础用法
|
|
118
|
+
export const Basic = {
|
|
119
|
+
render: (args) => ({
|
|
120
|
+
components: { JhDrawer },
|
|
121
|
+
data() {
|
|
122
|
+
return {
|
|
123
|
+
showDrawer: false,
|
|
124
|
+
...args
|
|
125
|
+
};
|
|
126
|
+
},
|
|
127
|
+
template: `
|
|
128
|
+
<div>
|
|
129
|
+
<v-btn color="primary" @click="showDrawer = true">打开抽屉</v-btn>
|
|
130
|
+
<jh-drawer
|
|
131
|
+
v-model="showDrawer"
|
|
132
|
+
:title="title"
|
|
133
|
+
:position="position"
|
|
134
|
+
:width="width"
|
|
135
|
+
:height="height"
|
|
136
|
+
:show-confirm-button="showConfirmButton"
|
|
137
|
+
:show-cancel-button="showCancelButton"
|
|
138
|
+
:show-close-button="showCloseButton"
|
|
139
|
+
:confirm-text="confirmText"
|
|
140
|
+
:cancel-text="cancelText"
|
|
141
|
+
@confirm="handleConfirm"
|
|
142
|
+
@cancel="handleCancel"
|
|
143
|
+
@open="handleOpen"
|
|
144
|
+
@close="handleClose"
|
|
145
|
+
>
|
|
146
|
+
<div class="pa-4">
|
|
147
|
+
<h3>自定义内容</h3>
|
|
148
|
+
<p>这里可以放置任何自定义内容,比如表单、列表、图表等。</p>
|
|
149
|
+
<v-alert type="info" class="mt-4">
|
|
150
|
+
这是一个信息提示框
|
|
151
|
+
</v-alert>
|
|
152
|
+
<v-text-field
|
|
153
|
+
label="输入框示例"
|
|
154
|
+
outlined
|
|
155
|
+
class="mt-4"
|
|
156
|
+
></v-text-field>
|
|
157
|
+
</div>
|
|
158
|
+
</jh-drawer>
|
|
159
|
+
</div>
|
|
160
|
+
`,
|
|
161
|
+
methods: {
|
|
162
|
+
handleConfirm() {
|
|
163
|
+
console.log('确认操作');
|
|
164
|
+
this.showDrawer = false;
|
|
165
|
+
},
|
|
166
|
+
handleCancel() {
|
|
167
|
+
console.log('取消操作');
|
|
168
|
+
},
|
|
169
|
+
handleOpen() {
|
|
170
|
+
console.log('抽屉已打开');
|
|
171
|
+
},
|
|
172
|
+
handleClose() {
|
|
173
|
+
console.log('抽屉已关闭');
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}),
|
|
177
|
+
args: {
|
|
178
|
+
title: '基础抽屉',
|
|
179
|
+
position: 'right',
|
|
180
|
+
width: '90%',
|
|
181
|
+
height: '60vh',
|
|
182
|
+
showConfirmButton: true,
|
|
183
|
+
showCancelButton: true,
|
|
184
|
+
showCloseButton: true,
|
|
185
|
+
confirmText: '确认',
|
|
186
|
+
cancelText: '取消'
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
// 左侧抽屉
|
|
191
|
+
export const LeftDrawer = {
|
|
192
|
+
render: (args) => ({
|
|
193
|
+
components: { JhDrawer },
|
|
194
|
+
data() {
|
|
195
|
+
return {
|
|
196
|
+
showDrawer: false,
|
|
197
|
+
...args
|
|
198
|
+
};
|
|
199
|
+
},
|
|
200
|
+
template: `
|
|
201
|
+
<div>
|
|
202
|
+
<v-btn color="primary" @click="showDrawer = true">打开左侧抽屉</v-btn>
|
|
203
|
+
<jh-drawer
|
|
204
|
+
v-model="showDrawer"
|
|
205
|
+
:title="title"
|
|
206
|
+
:position="position"
|
|
207
|
+
:width="width"
|
|
208
|
+
@confirm="showDrawer = false"
|
|
209
|
+
>
|
|
210
|
+
<div class="pa-4">
|
|
211
|
+
<h3>左侧抽屉内容</h3>
|
|
212
|
+
<p>这是从左侧滑出的抽屉。</p>
|
|
213
|
+
<v-list>
|
|
214
|
+
<v-list-item v-for="i in 5" :key="i">
|
|
215
|
+
<v-list-item-content>
|
|
216
|
+
<v-list-item-title>列表项 {{ i }}</v-list-item-title>
|
|
217
|
+
</v-list-item-content>
|
|
218
|
+
</v-list-item>
|
|
219
|
+
</v-list>
|
|
220
|
+
</div>
|
|
221
|
+
</jh-drawer>
|
|
222
|
+
</div>
|
|
223
|
+
`
|
|
224
|
+
}),
|
|
225
|
+
args: {
|
|
226
|
+
title: '左侧抽屉',
|
|
227
|
+
position: 'left',
|
|
228
|
+
width: '400px'
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
// 底部抽屉
|
|
233
|
+
export const BottomDrawer = {
|
|
234
|
+
render: (args) => ({
|
|
235
|
+
components: { JhDrawer },
|
|
236
|
+
data() {
|
|
237
|
+
return {
|
|
238
|
+
showDrawer: false,
|
|
239
|
+
...args
|
|
240
|
+
};
|
|
241
|
+
},
|
|
242
|
+
template: `
|
|
243
|
+
<div>
|
|
244
|
+
<v-btn color="primary" @click="showDrawer = true">底部抽屉</v-btn>
|
|
245
|
+
<jh-drawer
|
|
246
|
+
v-model="showDrawer"
|
|
247
|
+
:title="title"
|
|
248
|
+
:position="position"
|
|
249
|
+
:height="height"
|
|
250
|
+
:width="width"
|
|
251
|
+
:show-confirm-button="showConfirmButton"
|
|
252
|
+
:show-cancel-button="showCancelButton"
|
|
253
|
+
>
|
|
254
|
+
<div class="pa-4">
|
|
255
|
+
<h3>底部弹出内容</h3>
|
|
256
|
+
<p>适合移动端选择器、说明信息等。</p>
|
|
257
|
+
<v-divider class="my-4"></v-divider>
|
|
258
|
+
<v-list dense>
|
|
259
|
+
<v-list-item v-for="item in 3" :key="item">
|
|
260
|
+
<v-list-item-content>
|
|
261
|
+
<v-list-item-title>选项 {{ item }}</v-list-item-title>
|
|
262
|
+
<v-list-item-subtitle>附加描述信息</v-list-item-subtitle>
|
|
263
|
+
</v-list-item-content>
|
|
264
|
+
</v-list-item>
|
|
265
|
+
</v-list>
|
|
266
|
+
<div class="text-center mt-4">
|
|
267
|
+
<v-btn color="success" @click="showDrawer = false">完成</v-btn>
|
|
268
|
+
</div>
|
|
269
|
+
</div>
|
|
270
|
+
</jh-drawer>
|
|
271
|
+
</div>
|
|
272
|
+
`
|
|
273
|
+
}),
|
|
274
|
+
args: {
|
|
275
|
+
title: '底部抽屉',
|
|
276
|
+
position: 'bottom',
|
|
277
|
+
height: '50vh',
|
|
278
|
+
width: '100%',
|
|
279
|
+
showConfirmButton: false,
|
|
280
|
+
showCancelButton: false
|
|
281
|
+
}
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
// 自定义操作按钮
|
|
285
|
+
export const CustomActions = {
|
|
286
|
+
render: (args) => ({
|
|
287
|
+
components: { JhDrawer },
|
|
288
|
+
data() {
|
|
289
|
+
return {
|
|
290
|
+
showDrawer: false,
|
|
291
|
+
...args
|
|
292
|
+
};
|
|
293
|
+
},
|
|
294
|
+
template: `
|
|
295
|
+
<div>
|
|
296
|
+
<v-btn color="primary" @click="showDrawer = true">自定义操作按钮</v-btn>
|
|
297
|
+
<jh-drawer
|
|
298
|
+
v-model="showDrawer"
|
|
299
|
+
:title="title"
|
|
300
|
+
@confirm="showDrawer = false"
|
|
301
|
+
>
|
|
302
|
+
<template #actions>
|
|
303
|
+
<v-btn
|
|
304
|
+
class="elevation-0 grey lighten-4 mr-2"
|
|
305
|
+
small
|
|
306
|
+
@click="handleReset"
|
|
307
|
+
>
|
|
308
|
+
重置
|
|
309
|
+
</v-btn>
|
|
310
|
+
<v-btn
|
|
311
|
+
color="warning"
|
|
312
|
+
class="mr-2"
|
|
313
|
+
small
|
|
314
|
+
@click="handleSave"
|
|
315
|
+
>
|
|
316
|
+
保存
|
|
317
|
+
</v-btn>
|
|
318
|
+
<v-btn
|
|
319
|
+
color="success"
|
|
320
|
+
small
|
|
321
|
+
@click="handleSubmit"
|
|
322
|
+
>
|
|
323
|
+
提交
|
|
324
|
+
</v-btn>
|
|
325
|
+
</template>
|
|
326
|
+
|
|
327
|
+
<div class="pa-4">
|
|
328
|
+
<h3>自定义操作按钮</h3>
|
|
329
|
+
<p>这个抽屉使用了自定义的操作按钮。</p>
|
|
330
|
+
<v-form>
|
|
331
|
+
<v-text-field
|
|
332
|
+
label="姓名"
|
|
333
|
+
outlined
|
|
334
|
+
class="mb-4"
|
|
335
|
+
></v-text-field>
|
|
336
|
+
<v-text-field
|
|
337
|
+
label="邮箱"
|
|
338
|
+
type="email"
|
|
339
|
+
outlined
|
|
340
|
+
class="mb-4"
|
|
341
|
+
></v-text-field>
|
|
342
|
+
<v-textarea
|
|
343
|
+
label="备注"
|
|
344
|
+
v-for="i in 10"
|
|
345
|
+
outlined
|
|
346
|
+
rows="3"
|
|
347
|
+
></v-textarea>
|
|
348
|
+
</v-form>
|
|
349
|
+
</div>
|
|
350
|
+
</jh-drawer>
|
|
351
|
+
</div>
|
|
352
|
+
`,
|
|
353
|
+
methods: {
|
|
354
|
+
handleReset() {
|
|
355
|
+
console.log('重置表单');
|
|
356
|
+
},
|
|
357
|
+
handleSave() {
|
|
358
|
+
console.log('保存数据');
|
|
359
|
+
},
|
|
360
|
+
handleSubmit() {
|
|
361
|
+
console.log('提交表单');
|
|
362
|
+
this.showDrawer = false;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}),
|
|
366
|
+
args: {
|
|
367
|
+
title: '自定义操作'
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
// 无按钮抽屉
|
|
372
|
+
export const NoButtons = {
|
|
373
|
+
render: (args) => ({
|
|
374
|
+
components: { JhDrawer },
|
|
375
|
+
data() {
|
|
376
|
+
return {
|
|
377
|
+
showDrawer: false,
|
|
378
|
+
...args
|
|
379
|
+
};
|
|
380
|
+
},
|
|
381
|
+
template: `
|
|
382
|
+
<div>
|
|
383
|
+
<v-btn color="primary" @click="showDrawer = true">无按钮抽屉</v-btn>
|
|
384
|
+
<jh-drawer
|
|
385
|
+
v-model="showDrawer"
|
|
386
|
+
:title="title"
|
|
387
|
+
:show-confirm-button="showConfirmButton"
|
|
388
|
+
:show-cancel-button="showCancelButton"
|
|
389
|
+
:show-close-button="showCloseButton"
|
|
390
|
+
>
|
|
391
|
+
<div class="pa-4">
|
|
392
|
+
<h3>纯展示内容</h3>
|
|
393
|
+
<p>这个抽屉没有操作按钮,只用于展示内容。</p>
|
|
394
|
+
<v-card class="mt-4">
|
|
395
|
+
<v-card-title>信息卡片</v-card-title>
|
|
396
|
+
<v-card-text>
|
|
397
|
+
这里是一些详细信息的展示。
|
|
398
|
+
</v-card-text>
|
|
399
|
+
</v-card>
|
|
400
|
+
<div class="text-center mt-6">
|
|
401
|
+
<v-btn color="primary" @click="showDrawer = false">
|
|
402
|
+
我知道了
|
|
403
|
+
</v-btn>
|
|
404
|
+
</div>
|
|
405
|
+
</div>
|
|
406
|
+
</jh-drawer>
|
|
407
|
+
</div>
|
|
408
|
+
`
|
|
409
|
+
}),
|
|
410
|
+
args: {
|
|
411
|
+
title: '信息展示',
|
|
412
|
+
showConfirmButton: false,
|
|
413
|
+
showCancelButton: false,
|
|
414
|
+
showCloseButton: true
|
|
415
|
+
}
|
|
416
|
+
};
|
|
417
|
+
|
|
418
|
+
// 宽度配置
|
|
419
|
+
export const WidthConfig = {
|
|
420
|
+
render: (args) => ({
|
|
421
|
+
components: { JhDrawer },
|
|
422
|
+
data() {
|
|
423
|
+
return {
|
|
424
|
+
showDrawer1: false,
|
|
425
|
+
showDrawer2: false,
|
|
426
|
+
showDrawer3: false,
|
|
427
|
+
...args
|
|
428
|
+
};
|
|
429
|
+
},
|
|
430
|
+
template: `
|
|
431
|
+
<div>
|
|
432
|
+
<v-btn color="primary" class="mr-2" @click="showDrawer1 = true">
|
|
433
|
+
小抽屉 (400px)
|
|
434
|
+
</v-btn>
|
|
435
|
+
<v-btn color="primary" class="mr-2" @click="showDrawer2 = true">
|
|
436
|
+
中抽屉 (60%)
|
|
437
|
+
</v-btn>
|
|
438
|
+
<v-btn color="primary" @click="showDrawer3 = true">
|
|
439
|
+
大抽屉 (90%)
|
|
440
|
+
</v-btn>
|
|
441
|
+
|
|
442
|
+
<jh-drawer
|
|
443
|
+
v-model="showDrawer1"
|
|
444
|
+
title="小抽屉"
|
|
445
|
+
width="400px"
|
|
446
|
+
@confirm="showDrawer1 = false"
|
|
447
|
+
>
|
|
448
|
+
<div class="pa-4">
|
|
449
|
+
<p>这是一个固定宽度的小抽屉 (400px)</p>
|
|
450
|
+
</div>
|
|
451
|
+
</jh-drawer>
|
|
452
|
+
|
|
453
|
+
<jh-drawer
|
|
454
|
+
v-model="showDrawer2"
|
|
455
|
+
title="中抽屉"
|
|
456
|
+
width="60%"
|
|
457
|
+
@confirm="showDrawer2 = false"
|
|
458
|
+
>
|
|
459
|
+
<div class="pa-4">
|
|
460
|
+
<p>这是一个中等宽度的抽屉 (60%)</p>
|
|
461
|
+
</div>
|
|
462
|
+
</jh-drawer>
|
|
463
|
+
|
|
464
|
+
<jh-drawer
|
|
465
|
+
v-model="showDrawer3"
|
|
466
|
+
title="大抽屉"
|
|
467
|
+
width="90%"
|
|
468
|
+
@confirm="showDrawer3 = false"
|
|
469
|
+
>
|
|
470
|
+
<div class="pa-4">
|
|
471
|
+
<p>这是一个大宽度的抽屉 (90%)</p>
|
|
472
|
+
</div>
|
|
473
|
+
</jh-drawer>
|
|
474
|
+
</div>
|
|
475
|
+
`
|
|
476
|
+
}),
|
|
477
|
+
args: {}
|
|
478
|
+
};
|