Created
January 21, 2021 15:46
-
-
Save JackBoyle1/ba6bd5559458aa9867f53fd458f5d2e8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<GqlMutationForm v-bind="$attrs" @done="done"> | |
<template v-slot:form> | |
<slot name="form" /> | |
<OperatorNote :note="note" @note-update="noteUpdate" /> | |
</template> | |
<slot v-for="(_, name) in $slots" :slot="name" :name="name" /> | |
<template | |
v-for="(_, name) in $scopedSlots" | |
:slot="name" | |
slot-scope="slotData" | |
> | |
<slot :name="name" v-bind="{ ...slotData }" /> | |
</template> | |
</GqlMutationForm> | |
</div> | |
</template> | |
<script> | |
import GqlMutationForm from '@/components/GqlMutationForm' | |
import OperatorNote from '@/components/note/Note.vue' | |
import { noteMutation } from '@/components/note/noteMutation.js' | |
export default { | |
components: { | |
GqlMutationForm, | |
OperatorNote, | |
}, | |
props: { | |
type: { | |
type: String, | |
default: 'extract_method', | |
}, | |
}, | |
methods: { | |
done(entity) { | |
this.$emit('done', entity) | |
this.noteMutation( | |
this.$route.params.id, | |
this.type, | |
this.note, | |
this.$apollo | |
) | |
}, | |
noteUpdate(val) { | |
this.note = val | |
}, | |
}, | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment