Skip to content

Commit

Permalink
fix the problem of not updating the content in real time
Browse files Browse the repository at this point in the history
  • Loading branch information
lpreterite committed Oct 27, 2017
1 parent 90636f6 commit 006bf2f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion example/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var vm = new Vue({
})
},
{
content: '<p>多个文本测试</p><hr><p>第二行</p>',
content: '<p>Vue</p><hr><p>The Progressive JavaScript Framework</p>',
setting: {
language_url: "langs/zh_CN.js",
height: 200,
Expand Down
7 changes: 6 additions & 1 deletion src/vue-tinymce.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,14 @@ export default {
// console.log('init', this.value);
editor.setContent(this.value);
//fix execCommand not change ,more see issues#2
editor.on('input change undo redo execCommand', ()=>{
editor.on('input change undo redo execCommand KeyUp', ()=>{
if(this.status === INPUT || this.status === INIT) return this.status = CHANGED;
this.$emit('input', editor.getContent());
console.log('editor change', editor.getContent());
});
//fix have chang not to emit input,more see issues #4
editor.on('NodeChange', ()=>{
this.$emit('input', editor.getContent());
});
});
}
Expand Down

0 comments on commit 006bf2f

Please sign in to comment.