Skip to content

Commit

Permalink
#39, #40 Update value exist and update value when change
Browse files Browse the repository at this point in the history
  • Loading branch information
dangvanthanh committed Sep 19, 2017
1 parent 689d56e commit 57d6b03
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-ckeditor2",
"version": "1.11.0",
"version": "1.12.0",
"description": "Ckeditor using for Vue.js 2",
"main": "src/ckeditor.vue",
"peerDependencies": {
Expand Down
10 changes: 6 additions & 4 deletions src/ckeditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</template>

<script>
let inc = 0
let inc = new Date().getTime()
export default {
name: 'vue-ckeditor',
Expand Down Expand Up @@ -46,9 +46,11 @@ export default {
},
watch: {
value (val) {
let html = this.instance.getData()
if (val !== html) {
this.instance.setData(val, null, true)
if (this.instance) {
let html = this.instance.getData()
if (val !== html) {
this.instance.setData(val)
}
}
}
},
Expand Down

0 comments on commit 57d6b03

Please sign in to comment.