ankurk91 / vue-trumbowyg

Vue.js component for Trumbowyg WYSIWYG editor :memo:
https://ankurk91.github.io/vue-trumbowyg/
MIT License
236 stars 35 forks source link

Add custom html. #32

Closed vkiranananda closed 4 years ago

vkiranananda commented 4 years ago

Hello!

I want to add custom HTML where the cursor is. How to do it?

Thank you!

ankurk91 commented 4 years ago

Please ask such questions at https://github.com/Alex-D/Trumbowyg

vkiranananda commented 4 years ago

Ок. How I get access to $('#my-editor') ?

$('#my-editor').trumbowyg('execCmd', {
    cmd: 'insertText',
    param: 'TextToInsert',
    forceCss: false,
});
ankurk91 commented 4 years ago

You can add a ref="editor" to component and then access it like

// In your component
this.$refs.editor.el.trumbowyg();
vkiranananda commented 4 years ago

Thanks @ankurk91