Item management is the most advanced example included in the Pro theme, because every item has a picture, belongs to a category and has multiple tags. To access this example click the "Examples(API)/Items " link in the left sidebar or add /items-list to the URL. Here you can manage the items. A list of items will appear once you start adding them (to access the add page click "Add item "). On the add page, besides the Name and Description fields (which are present in most of the CRUD examples) you can see a category dropdown, which contains the categories you added, a file input and a tag multi select. If you did not add any categories or tags, please go to the corresponding sections (categories, tags) and add some.
You can find the compoments for item functionality in src\views\examples-api\items
folder.
The store used for item functionality is found in src\store\items.module.js
Item List Examples Copy
1 < table id = " item-list" ref = " table" class = " table table-flush" >
2 < thead class = " thead-light" >
3 < tr>
4 < th title = " name" class = " w-20" > Name</ th>
5 < th title = " category" class = " w-20" > Category</ th>
6 < th title = " picture" class = " w-20" > Picture</ th>
7 < th title = " tags" class = " w-20" > Tags</ th>
8 < th title = " created_at" class = " w-20" > Created at</ th>
9 < th data-sortable = " false" class = " text-end" > Action</ th>
10 </ tr>
11 </ thead>
12 < tbody class = " text-sm" >
13 </ tbody>
14 </ table> Add/Edit Examples Copy
1 < div class = " card-body" >
2 < form>
3 < div class = " mt-4 overflow-hidden" >
4 < div>
5 < material-avatar :img = " item.image" shadow = " regular" class = " img-fluid w-20 mt-7"
6 :fixedSize = " true" >
7 </ material-avatar>
8 </ div>
9 < div class = " mt-1 mb-2" >
10 < material-button size = " sm" type = " button" >
11 < label for = " imageInput" class = " mb-0 text-white small" > Select Image</ label>
12 < input id= "imageInput" @change. prevent= "onFileChange" type= "file"
13 style= "display: none;" >
14 </ material-button>
15 </ div>
16 </ div>
17
18 < div class = " mt-5" >
19 < material-input id = " name" label = " Name" v-model: value= " item.name" name = " name"
20 variant = " static" />
21 < validation-error :errors = " apiValidationErrors.name" />
22 </ div>
23
24 < div class = " mt-5" >
25 < label class = " ms-0" > Description </ label>
26 < material-textarea id = " description" v-model: value= " item.description"
27 name = " description" />
28 < validation-error :errors = " apiValidationErrors.description" />
29 </ div>
30
31 < ! -- selectedCategory-- >
32 < div class = " mt-5" >
33 < label class = " ms-0" > Category </ label>
34 < select id = " choices-categories" class = " multisteps-form__select form-control"
35 name = " choices-categories" >
36 </ select>
37 < validation-error :errors = " apiValidationErrors.category" />
38 </ div>
39
40 < ! -- selectedTag-- >
41 < div class = " mt-5" >
42 < label class = " ms-0" > Tags </ label>
43 < select multiple id = " choices-tags" class = " multisteps-form__select form-control"
44 name = " choices-tags" >
45 </ select>
46 < validation-error :errors = " apiValidationErrors.tags" />
47 </ div>
48
49 < ! -- selectedStatus-- >
50 < div class = " mt-5" >
51 < label class = " ms-0" > Status </ label>
52
53 < div class = " form-check ps-0" >
54 < input class = " form-check-input" type = " radio" name = " radio" id = " published"
55 value = " published" v-model = " item.status" >
56 < label class = " form-check-label" for = " published" > Published</ label>
57 </ div>
58 < div class = " form-check ps-0" >
59 < input class = " form-check-input" type = " radio" name = " radio" id = " draft" value = " draft"
60 v-model = " item.status" >
61 < label class = " form-check-label" for = " draft" > Draft</ label>
62 </ div>
63 < div class = " form-check ps-0" >
64 < input class = " form-check-input" type = " radio" name = " radio" id = " archive"
65 value = " archive" v-model = " item.status" >
66 < label class = " form-check-label" for = " archive" > Archive</ label>
67 </ div>
68 < validation-error :errors = " apiValidationErrors.status" />
69 </ div>
70
71 < ! -- showOnHomepage-- >
72 < div class = " mt-5" >
73 < label class = " ms-0" > Show on homepage? </ label>
74 < div class = " form-check form-switch mb-4" >
75 < input class = " form-check-input" type = " checkbox" id = " isOnHomepage"
76 v-model = " item.is_on_homepage" >
77 </ div>
78 < validation-error :errors = " apiValidationErrors.is_on_homepage" />
79 </ div>
80
81
82 < ! -- date-- >
83 < div class = " mt-5" >
84 < label class = " ms-0" > Date </ label>
85 < flatPickr v-model = " item.date_at" class = " form-control" placeholder = " Select date" >
86 </ flatPickr>
87 < validation-error :errors = " apiValidationErrors.date_at" />
88 </ div>
89
90 < div class = " button-row d-flex mt-4" >
91 < material- button type= "button" color= "dark" variant= "gradient"
92 class = "ms-auto mb-0 js-btn-next" @click= "handleAdd" > Add Item</ material-button>
93 </ div>
94 </ form>
95 </ div>
96