Created
March 6, 2019 03:39
-
-
Save patrickdavey/266bf06b39237dcc40679978fdd229d4 to your computer and use it in GitHub Desktop.
simple app to show destroy on vue-ckeditor2
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> | |
<vue-ckeditor | |
v-model="content" | |
:key="myKey" | |
:id="myKey" | |
:config="config" /> | |
<button @click="updateKey">Update Key</button> | |
<span :key="blah['id']" v-for="blah in instances"> | |
{{ blah["id"] }} | |
</span> | |
</div> | |
</template> | |
<script> | |
/* eslint-disable */ | |
import VueCkeditor from 'vue-ckeditor2'; | |
export default { | |
components: { VueCkeditor }, | |
data() { | |
return { | |
key: 1, | |
instances: [], | |
content: '', | |
config: { | |
toolbar: [ | |
['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript'] | |
], | |
height: 300 | |
} | |
}; | |
}, | |
computed: { | |
myKey () { | |
return `ck-${this.key}`; | |
} | |
}, | |
methods: { | |
updateKey () { | |
this.key += 1; | |
setTimeout(() => { | |
this.instances = window.CKEDITOR.instances; | |
}, 200); | |
} | |
} | |
}; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment