allow editing playlist name and comment

This commit is contained in:
Thomas Amland
2021-01-24 11:56:26 +01:00
parent 383334cfe5
commit 8e9a6ca26d
5 changed files with 95 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
<template>
<b-modal ok-title="Save" :visible="visible" @ok="confirm" @change="change">
<template #modal-title>
<slot name="title" :item="copy">
{{ title }}
</slot>
</template>
<template v-if="visible">
<slot :item="copy" />
</template>
</b-modal>
</template>
<script lang="ts">
import Vue from 'vue'
export default Vue.extend({
props: {
item: { type: Object, default: null },
visible: { type: Boolean, required: true },
title: { type: String, default: '' },
},
data() {
return {
copy: null,
}
},
watch: {
item: {
immediate: true,
handler(value: any) {
this.copy = { ...value }
}
}
},
methods: {
confirm() {
this.$emit('confirm', this.copy)
},
change() {
this.$emit('update:visible', false)
},
}
})
</script>
+2
View File
@@ -13,6 +13,7 @@ import {
BFormCheckbox,
BFormGroup,
BFormInput,
BFormTextarea,
BModal,
BOverlay,
BProgress,
@@ -27,6 +28,7 @@ Vue.component('BSidebar', BSidebar)
Vue.component('BFormGroup', BFormGroup)
Vue.component('BFormInput', BFormInput)
Vue.component('BFormCheckbox', BFormCheckbox)
Vue.component('BFormTextarea', BFormTextarea)
Vue.component('BButton', BButton)
Vue.component('BProgress', BProgress)
Vue.component('BOverlay', BOverlay)