Skip to content

Commit

Permalink
f content emptied after tag changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mariomka authored and hl037 committed Oct 2, 2022
1 parent 8df4396 commit 7dacb2b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
6 changes: 3 additions & 3 deletions dist/vue-contenteditable.cjs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions dist/vue-contenteditable.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
var _a;
updateContent((_a = props.modelValue) != null ? _a : "");
});
watch(() => props.tag, (newval, oldval) => {
var _a;
updateContent((_a = props.modelValue) != null ? _a : "");
}, { flush: "post" });
return (_ctx, _cache) => {
return openBlock(), createBlock(resolveDynamicComponent(__props.tag), {
contenteditable: __props.contenteditable,
Expand Down
6 changes: 3 additions & 3 deletions dist/vue-contenteditable.umd.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-contenteditable",
"version": "4.0.4",
"version": "4.1.0",
"scripts": {
"build": "vite build && vue-tsc --declaration --emitDeclarationOnly --outFile dist/vue-contenteditable.js"
},
Expand Down
4 changes: 4 additions & 0 deletions src/components/contenteditable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,9 @@ watch( () => props.noHtml, (newval, oldval) => {
updateContent(props.modelValue ?? '')
})
watch( () => props.tag, (newval, oldval) => {
updateContent(props.modelValue ?? '');
}, { flush: 'post' });
</script>

0 comments on commit 7dacb2b

Please sign in to comment.