source documents editable-file ok

This commit is contained in:
2024-04-03 16:21:09 +02:00
parent 34a0ec18e0
commit 24b41ed00d
6 changed files with 265 additions and 18 deletions

View File

@@ -20,7 +20,8 @@ export default {
props: {
can_update: Boolean,
links: Array,
data: Object
data: Object,
label: String
},
emits: ['updated'],
data(){
@@ -121,15 +122,15 @@ export default {
console.warn(`Issue with patch ${this.data.entitytype} ${this.data.bundle}`, error)
Promise.reject(error)
})
},
async onDeleteLink(i){
console.log(`onDeleteLink ${i}`, this.$refs.links_list.children[i]);
// this.links_nb = this.$refs.links_list.children.length;
// this.$refs.links_list.children[i].remove();
this.links.splice(i,1);
await nextTick();
this.buildLinkListThenSave(true);
}
},
async onDeleteLink(i){
console.log(`onDeleteLink ${i}`, this.$refs.links_list.children[i]);
// this.links_nb = this.$refs.links_list.children.length;
// this.$refs.links_list.children[i].remove();
this.links.splice(i,1);
await nextTick();
this.buildLinkListThenSave(true);
}
},
components: {
SvgIcon,
@@ -140,6 +141,7 @@ export default {
</script>
<template>
<label>{{ label }}</label>
<ul ref="links_list">
<li v-for="(link, l) in links" :key="l" :class="{'link-editable':can_update}">
<!-- link exists can't update -->