Created
May 9, 2020 21:51
-
-
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
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> | |
<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