mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Implement edit callback, fist step
This commit is contained in:
parent
58464fd53e
commit
280f0f5a78
@ -106,6 +106,10 @@ export default {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
callbackEdit: {
|
||||
type: Function,
|
||||
default: () => {},
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -155,7 +159,9 @@ export default {
|
||||
},
|
||||
handleEditSocialMedia(link) {
|
||||
this.editingLink = link
|
||||
this.formData.socialMediaUrl = link.url
|
||||
// Wolle this.formData.socialMediaUrl = link.url
|
||||
// Wolle this.$refs.socialMediaUrl.$el.focus()
|
||||
this.callbackEdit(this, link)
|
||||
},
|
||||
handleInput(data) {
|
||||
this.disabled = true
|
||||
|
||||
@ -1,5 +1,9 @@
|
||||
<template>
|
||||
<my-something-list :useFormData="useFormData" :useFormSchema="useFormSchema">
|
||||
<my-something-list
|
||||
:useFormData="useFormData"
|
||||
:useFormSchema="useFormSchema"
|
||||
:callbackEdit="callbackEditSocialMedia"
|
||||
>
|
||||
<template #list-item="{ link }">
|
||||
<social-media-list-item :link="link" />
|
||||
</template>
|
||||
@ -36,5 +40,18 @@ export default {
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
callbackEditSocialMedia(thisMySomethingList, link) {
|
||||
// Wolle this.editingLink = link
|
||||
thisMySomethingList.formData.socialMediaUrl = link.url
|
||||
// thisMySomethingList.$refs.socialMediaUrl.$el.focus()
|
||||
// !!! Check for existenz
|
||||
// this.$scopedSlots.default()[0].context.$refs
|
||||
// thisMySomethingList.$scopedSlots['edit-item']()[0].$el.focus()
|
||||
// console.log(thisMySomethingList.$scopedSlots['edit-item']()[0].context.$refs)
|
||||
// console.log(thisMySomethingList.$scopedSlots['edit-item']()[0].context.$refs)
|
||||
// console.log(thisMySomethingList.$refs)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user