94 lines
2.2 KiB
Vue
94 lines
2.2 KiB
Vue
<script setup>
|
|
const props = defineProps({
|
|
items: {
|
|
type: Array,
|
|
default: [],
|
|
},
|
|
menus: {
|
|
type: Array,
|
|
default: [],
|
|
},
|
|
});
|
|
|
|
|
|
const onSelectSearch = (option, el$) => {
|
|
const data = props.menus.find((i) => i.title == option)
|
|
console.log("baru",data.path)
|
|
el$.$parent.$parent.children$.path.update(data.path)
|
|
// if(data.path === undefined){
|
|
// }
|
|
}
|
|
</script>
|
|
<template>
|
|
<!-- {{props.menus}} -->
|
|
<ListElement
|
|
name="pages"
|
|
:default="props.items"
|
|
>
|
|
<template #default="{ index }">
|
|
<ObjectElement
|
|
:name="index"
|
|
class = "px-3 py-3 border border-gray-200 rounded-xl"
|
|
>
|
|
<!-- <TextElement
|
|
name="title"
|
|
:columns="{
|
|
container: 6,
|
|
}"
|
|
label="Module"
|
|
/> -->
|
|
<SelectElement
|
|
@select="onSelectSearch"
|
|
name="title"
|
|
:items="props.menus"
|
|
:search="true"
|
|
:native="false"
|
|
label="Module"
|
|
input-type="search"
|
|
autocomplete="of"
|
|
value-prop="title"
|
|
label-prop="title"
|
|
:create="true"
|
|
:add-option-on="[
|
|
'enter',
|
|
'tab',
|
|
'space',
|
|
]"
|
|
:columns="{
|
|
container: 6,
|
|
}"
|
|
/>
|
|
<TextElement
|
|
name="path"
|
|
label="Path"
|
|
:columns="{
|
|
container: 6,
|
|
}"
|
|
/>
|
|
<CheckboxgroupElement
|
|
name="permissions"
|
|
view="tabs"
|
|
:items="[
|
|
{
|
|
value: 'create',
|
|
label: 'create',
|
|
},
|
|
{
|
|
value: 'view',
|
|
label: 'view',
|
|
},
|
|
{
|
|
value: 'update',
|
|
label: 'update',
|
|
},
|
|
{
|
|
value: 'delete',
|
|
label: 'delete',
|
|
},
|
|
]"
|
|
label="Permissions"
|
|
/>
|
|
</ObjectElement>
|
|
</template>
|
|
</ListElement>
|
|
</template> |