Install the NPM docx-Preview plug-in
<template> <div class="home"> <div ref="file"></div> </div> </template> <script> import axios from 'axios' let docx = require('docx-preview'); Export default {mounted(){axios({method: 'get', responseType: 'blob', // Set response file format url: '/ docx'}). Then (({data}) = > {docx. RenderAsync (data, this. $refs. File) / / render to page preview})}} < / script >