I am currently working with HTML generated by a function on an external server and I am able to preview this within a tag. Additionally, I can retrieve the CSS information in a similar manner.
<template>
<div v-html="html"></div>
</template>
created() {
// Fetching HTML from external server
Axios.post(....).then((res) => {
this.html = res.data;
});
// Fetching CSS file from external server
Axios.post(....).then((res) => {
... apply this result to the html somehow
});
},
The HTML content is displayed correctly but now I am looking for a way to incorporate the styles from the CSS. Is there a method that can help me achieve this?
One approach I have attempted is embedding the CSS file directly into the HTML source:
<link rel='stylesheet' type='text/css' href='css/default.css' />
However, upon doing so, I encountered the following error:
Refused to apply style from 'http://localhost:8080/css/default.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.