File tree Expand file tree Collapse file tree 3 files changed +44
-1
lines changed Expand file tree Collapse file tree 3 files changed +44
-1
lines changed Original file line number Diff line number Diff line change 2
2
import { Link } from " @inertiajs/vue3"
3
3
import BaseButton from " @/Components/BaseButton.vue"
4
4
import BaseButtons from " @/Components/BaseButtons.vue"
5
+ import BaseIcon from ' @/Components/BaseIcon.vue'
5
6
import {
6
7
mdiSquareEditOutline ,
7
8
mdiTrashCan ,
@@ -30,7 +31,17 @@ const props = defineProps({
30
31
<template >
31
32
<tr :key =" item.id" >
32
33
<td data-label =" Name" >
33
- <div :style =" { 'margin-left': level*20 + 'px' }" >{{ item.name }}</div >
34
+ <div :style =" { 'margin-left': level*20 + 'px' }" >
35
+ <BaseIcon
36
+ v-if =" item.icon"
37
+ :path =" item.icon"
38
+ class =" flex-none"
39
+ :class =" activeInactiveStyle"
40
+ w =" w-16"
41
+ :size =" 18"
42
+ />
43
+ {{ item.name }}
44
+ </div >
34
45
</td >
35
46
<td data-label =" Description" >
36
47
{{ item.description }}
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ const form = useForm({
37
37
enabled: true ,
38
38
parent_id: ' ' ,
39
39
weight: ' ' ,
40
+ icon: ' ' ,
40
41
roles: []
41
42
})
42
43
@@ -152,6 +153,21 @@ const form = useForm({
152
153
</div >
153
154
</FormControl >
154
155
</FormField >
156
+ <FormField
157
+ label =" Icon"
158
+ :class =" { 'text-red-400': form.errors.icon }"
159
+ >
160
+ <FormControl
161
+ v-model =" form.icon"
162
+ type =" text"
163
+ placeholder =" Enter Icon Path"
164
+ :error =" form.errors.icon"
165
+ >
166
+ <div class =" text-red-400 text-sm" v-if =" form.errors.icon" >
167
+ {{ form.errors.icon }}
168
+ </div >
169
+ </FormControl >
170
+ </FormField >
155
171
156
172
<BaseDivider />
157
173
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ const form = useForm({
47
47
enabled: props .item .enabled ,
48
48
parent_id: props .item .parent_id ,
49
49
weight: props .item .weight ,
50
+ icon: props .item .icon ,
50
51
roles: props .itemHasRoles
51
52
})
52
53
</script >
@@ -161,6 +162,21 @@ const form = useForm({
161
162
</div >
162
163
</FormControl >
163
164
</FormField >
165
+ <FormField
166
+ label =" Icon"
167
+ :class =" { 'text-red-400': form.errors.icon }"
168
+ >
169
+ <FormControl
170
+ v-model =" form.icon"
171
+ type =" text"
172
+ placeholder =" Enter Icon Path"
173
+ :error =" form.errors.icon"
174
+ >
175
+ <div class =" text-red-400 text-sm" v-if =" form.errors.icon" >
176
+ {{ form.errors.icon }}
177
+ </div >
178
+ </FormControl >
179
+ </FormField >
164
180
165
181
<BaseDivider />
166
182
You can’t perform that action at this time.
0 commit comments