I'm trying to create a Vue SPA app which needs to support old modules of the system. I want to create backward-compatible components which will get a full HTML module through an ajax request and insert it inside the component.
The problem is the excepted HTML contains relevant scripts that should be included. is there any option to inject js files from the server through HTML code
<template>
<div class="container" v-html="html"></div>
</template>
<script>
import { mapState } from "vuex";
export default {
name: "comp",
data() {
return {
html: null
};
},
mounted() {
fetch('http://localhost:8090/api/html/response')
.then(response => {
return response.text();
})
.then(data => {
this.html= data;
})
}
};