0๐
<div v-html="compiledHtml"></div>
data: function() {
return {
fileName: "terms.html",
input: ""
};
},
created() {
this.fileName = this.$route.params.fileName;
this.loadFile()
}
computed: {
compiledHtml: function() {
return this.input;
}
},
methods: {
loadFile() {
axios({
method: "get",
url: "../../static/" + this.fileName
})
.then(result => {
this.input = result.data;
})
.catch(error => {
console.error("error getting file");
});
}
},
the trick is the computed property
Source:stackexchange.com