I am looking to store HTML in a variable within my Vue.js 3 setup()
function so that I can use it later in the template.
However, when I attempt to do so, I encounter an error message stating
"VueCompilerError: Invalid end tag."
. It appears that Vue is mistaking the HTML for part of the component's code, even though it is not.
<script>
imports...
setup() {
const a = valueA;
const b = valueB;
const MyHTML = '<script></script>' // Vue falsely interprets the </script> tag as code
}
</script> // This results in a VueCompilerError: Invalid end tag.
Is there a way to save HTML as a string in a variable without Vue trying to parse it?