@@ -8,6 +8,7 @@ description: Base dropdown button, suit for action menus
8
8
import pInput from " ../input/Input.vue"
9
9
import pDropdown from " ./Dropdown.vue"
10
10
import pDropdownItem from " ./DropdownItem.vue"
11
+ import pDropdownText from " ./DropdownText.vue"
11
12
import pDropdownHeader from ' ./DropdownHeader.vue'
12
13
import pAccordionItem from ' ../accordion/AccordionItem.vue'
13
14
import Banner from ' ../banner/Banner.vue'
@@ -21,6 +22,7 @@ description: Base dropdown button, suit for action menus
21
22
const show = ref (false )
22
23
const selected = ref (' ' )
23
24
const sample = ref (false )
25
+ const radio = ref (' ' )
24
26
</script >
25
27
26
28
# Dropdown
@@ -41,7 +43,7 @@ description: Base dropdown button, suit for action menus
41
43
``` vue
42
44
<template>
43
45
<p-dropdown text="Click Here">
44
- <p-dropdown-item>Item Text</p-dropdown-item>
46
+ <p-dropdown-item active >Item Text</p-dropdown-item>
45
47
<p-dropdown-item>Item Text</p-dropdown-item>
46
48
<p-dropdown-item>Item Text</p-dropdown-item>
47
49
</p-dropdown>
@@ -209,34 +211,29 @@ You can combine placement with suffix `*-start` and `*-end` to set popup positio
209
211
210
212
### Variant, Color and Size
211
213
212
- Every props in [ Button] [ button ] like ` variant ` , ` color ` , ` size ` , ` pill ` and ` icon ` also works in here.
214
+ Every props in [ Button] [ button ] like ` variant ` , ` color ` , ` size ` and ` icon ` also works in here.
213
215
Check out [ Button] [ button ] for more information.
214
216
215
217
<preview >
216
218
<p-dropdown
217
219
text="Button"
218
- variant="outline"
219
- color="secondary"
220
- size="lg"
221
- pill
222
- icon>
223
- <p-dropdown-item >Item Text</p-dropdown-item >
224
- <p-dropdown-item >Item Text</p-dropdown-item >
220
+ variant="link"
221
+ color="info">
222
+ <p-dropdown-item active >Item Text</p-dropdown-item >
225
223
<p-dropdown-item >Item Text</p-dropdown-item >
224
+ <p-dropdown-item disabled >Item Text</p-dropdown-item >
226
225
</p-dropdown >
227
226
</preview >
228
227
229
228
``` vue
230
229
<template>
231
230
<p-dropdown
232
231
text="Button"
233
- variant="outline"
234
- color="secondary"
235
- size="lg"
236
- pill>
237
- <p-dropdown-item>Item Text</p-dropdown-item>
238
- <p-dropdown-item>Item Text</p-dropdown-item>
232
+ variant="link"
233
+ color="info">
234
+ <p-dropdown-item active>Item Text</p-dropdown-item>
239
235
<p-dropdown-item>Item Text</p-dropdown-item>
236
+ <p-dropdown-item disabled>Item Text</p-dropdown-item>
240
237
</p-dropdown>
241
238
</template>
242
239
```
@@ -308,6 +305,123 @@ You can also completely change dropdown's activator button to something else via
308
305
</template>
309
306
```
310
307
308
+ ### Custom dropdown item
309
+
310
+ #### With checkbox
311
+ <preview >
312
+ <p-dropdown
313
+ text="Label">
314
+ <p-dropdown-text >
315
+ <p-checkbox >Checklist Label</p-checkbox >
316
+ </p-dropdown-text >
317
+ <p-dropdown-text >
318
+ <p-checkbox >Checklist Label</p-checkbox >
319
+ </p-dropdown-text >
320
+ <p-dropdown-text >
321
+ <p-checkbox >Checklist Label</p-checkbox >
322
+ </p-dropdown-text >
323
+ </p-dropdown >
324
+ </preview >
325
+
326
+ ``` vue
327
+ <template>
328
+ <p-dropdown
329
+ text="Label">
330
+ <p-dropdown-text>
331
+ <p-checkbox>Checklist Label</p-checkbox>
332
+ </p-dropdown-text>
333
+ <p-dropdown-text>
334
+ <p-checkbox>Checklist Label</p-checkbox>
335
+ </p-dropdown-text>
336
+ <p-dropdown-text>
337
+ <p-checkbox>Checklist Label</p-checkbox>
338
+ </p-dropdown-text>
339
+ </p-dropdown>
340
+ </template>
341
+ ```
342
+
343
+
344
+ #### With radio
345
+ <preview >
346
+ <p-dropdown
347
+ text="Label">
348
+ <p-dropdown-text >
349
+ <p-radio v-model =" radio " value =" list 1 " >Checklist Label</p-radio >
350
+ </p-dropdown-text >
351
+ <p-dropdown-text >
352
+ <p-radio v-model =" radio " value =" list 2 " >Checklist Label</p-radio >
353
+ </p-dropdown-text >
354
+ <p-dropdown-text >
355
+ <p-radio v-model =" radio " value =" list 3 " >Checklist Label</p-radio >
356
+ </p-dropdown-text >
357
+ </p-dropdown >
358
+ </preview >
359
+
360
+ ``` vue
361
+ <template>
362
+ <p-dropdown
363
+ text="Label">
364
+ <p-dropdown-text>
365
+ <p-radio v-model="radio" value="list 1">Checklist Label</p-radio>
366
+ </p-dropdown-text>
367
+ <p-dropdown-text>
368
+ <p-radio v-model="radio" value="list 2">Checklist Label</p-radio>
369
+ </p-dropdown-text>
370
+ <p-dropdown-text>
371
+ <p-radio v-model="radio" value="list 3">Checklist Label</p-radio>
372
+ </p-dropdown-text>
373
+ </p-dropdown>
374
+ </template>
375
+ ```
376
+
377
+ #### With radio option
378
+ <preview >
379
+ <p-dropdown
380
+ text="Label">
381
+ <p-dropdown-text >
382
+ <p-radio v-model =" radio " appearance =" option " value =" list 1 " >Checklist Label</p-radio >
383
+ </p-dropdown-text >
384
+ <p-dropdown-text >
385
+ <p-radio v-model =" radio " appearance =" option " value =" list 2 " >Checklist Label</p-radio >
386
+ </p-dropdown-text >
387
+ <p-dropdown-text >
388
+ <p-radio v-model =" radio " appearance =" option " value =" list 3 " >Checklist Label</p-radio >
389
+ </p-dropdown-text >
390
+ </p-dropdown >
391
+ </preview >
392
+
393
+ ``` vue
394
+ <template>
395
+ <p-dropdown
396
+ text="Label">
397
+ <p-dropdown-text>
398
+ <p-radio
399
+ v-model="option"
400
+ appearance="option"
401
+ value="list 1">
402
+ Checklist Label
403
+ </p-radio>
404
+ </p-dropdown-text>
405
+ <p-dropdown-text>
406
+ <p-radio
407
+ v-model="option"
408
+ appearance="option"
409
+ value="list 2">
410
+ Checklist Label
411
+ </p-radio>
412
+ </p-dropdown-text>
413
+ <p-dropdown-text>
414
+ <p-radio
415
+ v-model="option"
416
+ appearance="option"
417
+ value="list 3">
418
+ Checklist Label
419
+ </p-radio>
420
+ </p-dropdown-text>
421
+ </p-dropdown>
422
+ </template>
423
+ ```
424
+
311
425
## Disabled State
312
426
313
427
<preview >
@@ -330,6 +444,34 @@ You can also completely change dropdown's activator button to something else via
330
444
</template>
331
445
```
332
446
447
+ ## Dropdown Text
448
+ <preview >
449
+ <p-dropdown
450
+ text="Label">
451
+ <p-dropdown-text >
452
+ But I must explain to you how all this mistaken idea of denouncing pleasure
453
+ <span class =" block mt-2 " >And this is more example text</span >
454
+ </p-dropdown-text >
455
+ <p-dropdown-item >Item Text</p-dropdown-item >
456
+ <p-dropdown-item >Item Text</p-dropdown-item >
457
+ </p-dropdown >
458
+ </preview >
459
+
460
+ ``` vue
461
+ <template>
462
+ <p-dropdown
463
+ text="Label">
464
+ <p-dropdown-text>
465
+ But I must explain to you how all
466
+ this mistaken idea of denouncing pleasure
467
+ <span class="block mt-2">And this is more example text</span>
468
+ </p-dropdown-text>
469
+ <p-dropdown-item>Item Text</p-dropdown-item>
470
+ <p-dropdown-item>Item Text</p-dropdown-item>
471
+ </p-dropdown>
472
+ </template>
473
+ ```
474
+
333
475
## Dropdown Header
334
476
<preview >
335
477
<p-dropdown
0 commit comments