Skip to content

Commit

Permalink
fix(vue): delete undefined values
Browse files Browse the repository at this point in the history
  • Loading branch information
pd4d10 committed Jun 30, 2020
1 parent 25d28a6 commit 2caf118
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/bytemd/vue/src/editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,14 @@ export default {
watch: {
$props: {
handler(newValue, oldValue) {
this.editor.$set({ ...newValue });
// TODO:
const copy = { ...newValue };
for (let k in copy) {
if (copy[k] === undefined) {
delete copy[k];
}
}
this.editor.$set(copy);
},
deep: true,
},
Expand Down

0 comments on commit 2caf118

Please sign in to comment.