-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #79 from what-crud/29-add_multiselect_field_type
29 add multiselect field type
- Loading branch information
Showing
16 changed files
with
881 additions
and
404 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
# Item details | ||
|
||
Item details form is a modal dialog that shows when user click for create or edit selected item. This component is an integral part of `crud` component but you can customize it if you wish. | ||
You can achieve it using the slots: | ||
|
||
``` html | ||
<template> | ||
<crud | ||
:prefix="prefix" | ||
:path="path" | ||
:page-title="pageTitle" | ||
:fields-info="fieldsInfo" | ||
:details-title="$t('detailsTitle')" | ||
> | ||
|
||
<!-- Example of slot usage: --> | ||
<template #item-details-under-fields> | ||
Lorem ipsum... | ||
</template> | ||
|
||
</crud> | ||
</template> | ||
``` | ||
|
||
## Slots | ||
|
||
### **item-details-title** | ||
|
||
Slot for dialog title. | ||
|
||
Slot scope: { title } | ||
|
||
Default template: | ||
|
||
```html | ||
<v-card-title | ||
class="headline" | ||
> | ||
{{ details.action == 'multiedit' ? $t('global.details.multipleUpdateTitle') : title }} | ||
</v-card-title> | ||
``` | ||
|
||
Example: | ||
```html | ||
<template #item-details-title="{ title }"> | ||
{{ title }} | ||
</template> | ||
``` | ||
|
||
### **item-details-over-fields** | ||
|
||
Slot for content over the item fields. | ||
|
||
Slot scope: {} | ||
|
||
Example: | ||
```html | ||
<template #item-details-over-fields> | ||
Lorem ipsum... | ||
</template> | ||
``` | ||
|
||
### **item-details-field:[name]** | ||
|
||
Dynamic slot for selected field. | ||
|
||
Slot scope: { | ||
value, | ||
fieldType, | ||
field, | ||
reload, | ||
rules, | ||
changeValue, | ||
} | ||
|
||
Example: | ||
```html | ||
<template #item-details-field:name="{ value, changeValue }"> | ||
<input | ||
style="border: 1px solid black" | ||
v-model="value" | ||
@change="changeValue(value)" | ||
/> | ||
</template> | ||
<template #item-details-field:code="{ value, changeValue }"> | ||
<input | ||
style="border: 1px solid black; color: white; background-color: red;" | ||
v-model="value" | ||
@change="changeValue(value)" | ||
/> | ||
</template> | ||
``` | ||
|
||
### **item-details-under-fields** | ||
|
||
Slot for content under the item fields. | ||
|
||
Slot scope: {} | ||
|
||
Example: | ||
```html | ||
<template #item-details-under-fields> | ||
Lorem ipsum... | ||
</template> | ||
``` | ||
|
||
### **item-details-custom-actions** | ||
|
||
Slot for custom actions. | ||
|
||
Slot scope: {} | ||
|
||
Example: | ||
```html | ||
<template #item-details-custom-actions> | ||
<button>Custom action</button> | ||
</template> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.