feat(fe playlist): added playlist editor component
This commit is contained in:
parent
207450ef0a
commit
7d13b484bc
1 changed files with 59 additions and 0 deletions
59
resources/js/components/content/partials/PlaylistEditor.vue
Normal file
59
resources/js/components/content/partials/PlaylistEditor.vue
Normal file
|
@ -0,0 +1,59 @@
|
|||
<script setup lang="ts">
|
||||
import {playlist} from "@/composables/content/models/playlist.ts";
|
||||
|
||||
const props = defineProps({
|
||||
item: Object,
|
||||
})
|
||||
|
||||
console.log(props.item.id)
|
||||
const item = (): object => {
|
||||
if (props.item.id === 0) {
|
||||
return {
|
||||
id: 0,
|
||||
name: '',
|
||||
creator_id: 0,
|
||||
description: '',
|
||||
}
|
||||
} else {
|
||||
return props.item
|
||||
}
|
||||
}
|
||||
console.log(item())
|
||||
|
||||
const playlistFields = playlist(item())
|
||||
console.log(playlistFields())
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<v-row no-gutters>
|
||||
<v-col>
|
||||
<v-form>
|
||||
<Component
|
||||
v-for="(field, key) in playlistFields()"
|
||||
:is="field.component"
|
||||
:label="field.label"
|
||||
:value="field.value"
|
||||
:disabled="field.disabled"
|
||||
v-model="item()[key]"
|
||||
item-title="type_name"
|
||||
density="compact"
|
||||
hide-details="auto"
|
||||
class="mb-2"
|
||||
clearable
|
||||
:active="true"
|
||||
/>
|
||||
</v-form>
|
||||
</v-col>
|
||||
<v-col></v-col>
|
||||
</v-row>
|
||||
<v-row no-gutters>
|
||||
<v-btn
|
||||
color="accent"
|
||||
@click="$emit('goBack')"
|
||||
>Torna indietro</v-btn>
|
||||
</v-row>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
Loading…
Add table
Add a link
Reference in a new issue