aloha-vue 1.0.310 → 1.0.311
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -55,8 +55,15 @@ export default function ATinymceAPI(props, context, {
|
|
|
55
55
|
const modelValue = toRef(props, "modelValue");
|
|
56
56
|
|
|
57
57
|
let vueEditor = null;
|
|
58
|
+
let modelValueLocal = undefined;
|
|
59
|
+
|
|
60
|
+
const changeModelLocal = ({ model }) => {
|
|
61
|
+
modelValueLocal = model;
|
|
62
|
+
changeModel({ model });
|
|
63
|
+
};
|
|
58
64
|
|
|
59
65
|
const render = () => {
|
|
66
|
+
modelValueLocal = modelValue.value;
|
|
60
67
|
tinymce.init({
|
|
61
68
|
selector: `#${ htmlIdLocal.value }`,
|
|
62
69
|
plugins: plugins.value,
|
|
@@ -75,7 +82,7 @@ export default function ATinymceAPI(props, context, {
|
|
|
75
82
|
setup: editor => {
|
|
76
83
|
vueEditor = editor;
|
|
77
84
|
editor.on("change input undo redo", () => {
|
|
78
|
-
|
|
85
|
+
changeModelLocal({ model: editor.getContent({ format: "html" }) });
|
|
79
86
|
});
|
|
80
87
|
},
|
|
81
88
|
});
|
|
@@ -94,7 +101,10 @@ export default function ATinymceAPI(props, context, {
|
|
|
94
101
|
});
|
|
95
102
|
|
|
96
103
|
watch(modelValue, newValue => {
|
|
97
|
-
|
|
104
|
+
if (newValue !== modelValueLocal) {
|
|
105
|
+
tinymce.get(htmlIdLocal.value).setContent(newValue);
|
|
106
|
+
modelValueLocal = newValue;
|
|
107
|
+
}
|
|
98
108
|
});
|
|
99
109
|
|
|
100
110
|
onBeforeUnmount(() => {
|