This commit is contained in:
Baghi330 2026-02-14 16:26:26 +03:30
parent 5cb4b9aff6
commit 214a840d8a

View File

@ -12,15 +12,13 @@
:key="index"
@click="btn.action(editor)"
:class="{ 'is-active': btn.isActive ? btn.isActive(editor) : false }"
:disabled="btn.disabled ? !btn.disabled(editor) : false"
:disabled="readOnly || (btn.disabled ? btn.disabled(editor) : false)"
:title="btn.title"
>
<span class="toolbar-icon">{{ btn.icon }}</span>
</button>
</div>
</div>
<!-- محتوای ادیتور -->
<editor-content :editor="editor" class="editor-content" />
</div>
</template>
@ -42,6 +40,10 @@ const props = defineProps({
type: Array,
default: () => [],
},
readOnly: {
type: Boolean,
default: true,
},
});
const editor = ref(null);
@ -298,6 +300,7 @@ watch(
);
onMounted(() => {
editor.value = new Editor({
editable: !props.readOnly,
extensions: [
StarterKit,
Underline,
@ -431,7 +434,7 @@ onBeforeUnmount(() => {
.tiptap {
font-family:
"Vazir",
"sahel",
"Inter",
-apple-system,
BlinkMacSystemFont,