frappe-ui 0.1.248 → 0.1.249
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
|
@@ -94,7 +94,6 @@ const props = withDefaults(defineProps<TextEditorProps>(), {
|
|
|
94
94
|
tags: () => [],
|
|
95
95
|
})
|
|
96
96
|
|
|
97
|
-
const model = defineModel()
|
|
98
97
|
const emit = defineEmits<TextEditorEmits>()
|
|
99
98
|
|
|
100
99
|
const editor = ref<Editor | null>(null)
|
|
@@ -120,12 +119,10 @@ const editorProps = computed(() => {
|
|
|
120
119
|
})
|
|
121
120
|
|
|
122
121
|
watch(
|
|
123
|
-
() =>
|
|
124
|
-
(
|
|
125
|
-
const val = content || modelVal
|
|
126
|
-
|
|
122
|
+
() => props.content,
|
|
123
|
+
(val) => {
|
|
127
124
|
if (editor.value) {
|
|
128
|
-
|
|
125
|
+
let currentHTML = editor.value.getHTML()
|
|
129
126
|
if (currentHTML !== val) {
|
|
130
127
|
editor.value.commands.setContent(val)
|
|
131
128
|
}
|
|
@@ -156,7 +153,7 @@ watch(
|
|
|
156
153
|
|
|
157
154
|
onMounted(() => {
|
|
158
155
|
editor.value = new Editor({
|
|
159
|
-
content: props.content ||
|
|
156
|
+
content: props.content || null,
|
|
160
157
|
editorProps: editorProps.value,
|
|
161
158
|
editable: props.editable,
|
|
162
159
|
autofocus: props.autofocus,
|
|
@@ -240,9 +237,7 @@ onMounted(() => {
|
|
|
240
237
|
...(props.extensions || []),
|
|
241
238
|
],
|
|
242
239
|
onUpdate: ({ editor }) => {
|
|
243
|
-
|
|
244
|
-
emit('change', html)
|
|
245
|
-
model.value = html
|
|
240
|
+
emit('change', editor.getHTML())
|
|
246
241
|
},
|
|
247
242
|
onTransaction: ({ editor }) => {
|
|
248
243
|
emit('transaction', editor)
|