I am very new to Vue JS. Currently, I'm finding a way to render an HTML page that is sent by the server. Lest's assume I have a node router "health" that sends an HTML file as follows.
res.sendFile('test.html', { root: path.dirname(require.main.filename) + '/public/' });
In that case, can I try to access that file and render it this way by Vue JS?
<div id="app">
<div v-html="reactPage"></div>
</div>
<script>
let sessionId = "";
(function() {
const app = new Vue({
el: '#app',
data: {
reactPage: undefined
},
created() {
fetch('launch/health')
.then(response => {
this.reactPage = response;
})
}
})
})();
This code is not working as I expected.