Skip to content

Commit

Permalink
feat(events): support to event blur
Browse files Browse the repository at this point in the history
Added support to event blur
  • Loading branch information
iliyaZelenko committed May 1, 2020
2 parents 2cd5b20 + 2180669 commit 544f684
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/components/TiptapVuetify.vue
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ export default class TiptapVuetify extends Vue {
}
},
content: this[PROPS.VALUE],
onUpdate: this.onUpdate.bind(this)
onUpdate: this.onUpdate.bind(this),
onBlur: this.onBlur.bind(this)
}))!
this.$emit(EVENTS.INIT, {
Expand All @@ -254,6 +255,10 @@ export default class TiptapVuetify extends Vue {
this.$emit(EVENTS.INPUT, output, info)
}
onBlur ({ event, view }) {
this.$emit(EVENTS.BLUR, event, view)
}
beforeDestroy () {
if (this.editor) this.editor.destroy()
}
Expand Down
3 changes: 2 additions & 1 deletion src/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ export const VuetifyVuePrototypeProperty = '$vuetify'

export const EVENTS = {
INPUT: 'input' as const,
INIT: 'init' as const
INIT: 'init' as const,
BLUR: 'blur' as const
}

export const PROPS = {
Expand Down

0 comments on commit 544f684

Please sign in to comment.