使用officeOnline進行編輯,
注意事項見 http://www.manongjc.com/detail/6-ihinsaimaluazsf.html
然后使用webview打開就行,
<web-view :webview-styles="webviewStyles" :src="' http://view.officeapps.live.com/op/view.aspx?src='+this.fileSrc"></web-view>
稍微設置一下樣式:
webviewStyles: {
progress: {
color: '#FF3333'
}
},
注意:對路徑中src后邊部分進行encodeURIComponent編碼
this.fileSrc=encodeURIComponent(option.openFileUrl)
並且 src地址需要填寫80端口域名,不能是服務器ip地址。
我這邊由於路徑還沒改為域名地址,沒有打開。
當然手機端也可以跳轉第三方軟件手機版的office打開軟件也可以,但是需要先下載文檔。
web端同理。