This repository was archived by the owner on May 17, 2024. It is now read-only.
A new way of rendering HTML snippets inside a component #2375
delapuente
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
There are situations in which you want to group a list of content and metadata for parametrizing components:
Potentially, you would want to include HTML markup for formatting, such as
<strong>
or<li>
:When dealing with the first structure, we can use template interpolation but when dealing with the second, we need to use
v-html
directive.The problem with using
v-html
is the the DOM is not processed by Vue.js and so it can cause unexpected behaviour such as not being scoped for CSS and it is also vunerable to XSS attacks sometimes. It would be better to switch to a component approach but the boilerplate is too high for these simple usages.This issue is about investigating/inventing a solution for this problem.
Beta Was this translation helpful? Give feedback.
All reactions