问题
I am building an application using laravel and vuejs but for some reason I cannot use tinymce properly.
I see the editor as I want and write whatever I want in it. But when I try to view the content, all the html tags show as you can see in the image
I installed it following the github documentation here
npm install @tinymce/tinymce-vue
Imported in my vue template
import Editor from '@tinymce/tinymce-vue';
components: {
'editor' : Editor
}
And then I bind the element
<editor v-model="post.description"></editor>
So instead of showing " This text will be bold", it should show me "This text will be bold"
回答1:
After some research I ended up realising that I had to use the v-html in order to read the html tags
so instead of showing like this:
<td>{{post.description}}<td>
I am now doing the following:
<td v-html="post.description"><td>
回答2:
I think you are using TinyMCE proper way. It returns HTML, not a plain text. And when you remove tags from that returned HTML, you will lost all formatting, images and links. But if this is what are you looking for, just dive into TinyMCE documentation - it's a question of configuration.
来源:https://stackoverflow.com/questions/50953623/how-to-ignore-html-tags-in-tinymce-vuejs-and-laravel