Skip to content

Instantly share code, notes, and snippets.

@mcanvar
Created May 9, 2020 21:51
Show Gist options
  • Save mcanvar/65f72c3713a72361bd97511a99b8db71 to your computer and use it in GitHub Desktop.
Save mcanvar/65f72c3713a72361bd97511a99b8db71 to your computer and use it in GitHub Desktop.
Workaround for "Cannot read property 'set' of undefined - vue.JS #116" https://github.com/froala/vue-froala-wysiwyg/issues/116
<template>
<froala :tag="tag" ref="froalaEditor" :config="config" v-model="htmlValue"
:name="name" :id="id"></froala>
</template>
<script>
export default {
props: {
tag: {
type: String,
default: 'textarea'
},
config: {
type: Object,
default: () => {
return {
key: 'license_key',
attribution: false,
entities: ''
}
}
},
id: String,
name: {
type: String,
required: true
},
value: {
type: String
}
},
computed: {
htmlValue: {
get() {
return this.value;
},
set(value) {
this.$emit('input', value);
}
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment