如何显示来自Vuejs中Quill的值
我在VUE3应用程序中使用Quill Text Editor。因此,我将文本编辑器放在管理面板中,并且在API中存储了结果。因此,例如,它是API视图:
{ description: "<p><strong><em>Description</em></strong></p>" }
因此描述是来自Quill Text Editor的值。因此,我想这样的前端显示此信息:&lt; div&gt; {{product.attributes.description}}}&lt;/div&gt;
,但结果就像您在图片中看到的结果一样。
那么,我该如何以适当的方式显示出大胆和斜体的正确方式?
I am using Quill text editor in my Vue3 application. So I have my text editor in admin panel and I am storing result in the api. So for example it is the api view:
{ description: "<p><strong><em>Description</em></strong></p>" }
So description is the value coming from quill text editor. So I want to show this in front end like this: <div>{{ product.attributes.description }}</div>
but the result is like you see in the picture.
So how can I show this one in proper way which is bold and italic?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用
V-HTML
指令:You can use
v-html
directive:使用V-HTML,不要忘记将QL-编辑器类添加到元素中以正确显示您的内容。
如果您只显示文本,则可以很好地奏效,假设您想使用V-HTML显示图像的内容不会响应地显示内容。这是我使用Quil Editor ReadOnly = true解决它的方式。
Use v-HTML, and don't forget to add the ql-editor class to the element in order to display your content correctly.
this works well if you only display text, Let's say you want to show content with images using v-html won't display content responsively. here is how I solved it using Quil editor readOnly=true.