Search This Blog

2018/07/03

Get file data by axios|Vue.js

<template>
    <div class="col-lg-12" v-html="rawHtml">
</div>
</template>
axios.get('/assets/includes/test.html')
.then((res) => {
    if (res.status === 200) {
        this.rawHtml = res.data;
    } else {
        console.log(res.status);
    }
})
.catch((error) => {
    console.log(error);
});
Also can get json file.

No comments :

Post a Comment