我找到了一个简单的解决方案,react-router
在此更改后工作正常。我们可以在 中将函数失效前备份Office.js
,index.html
然后恢复:
<script>
window.backupHistoryFunctions = {};
window.backupHistoryFunctions.pushState = window.history.pushState;
window.backupHistoryFunctions.replaceState = window.history.replaceState;
</script>
<!-- Office JavaScript API -->
<script type="text/javascript" src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js">
</script>
<script>
window.history.pushState = window.backupHistoryFunctions.pushState;
window.history.replaceState = window.backupHistoryFunctions.replaceState;
console.log(window.history.replaceState)
</script>
正如微软代表指出的那样,这与 Excel 不兼容,但我想这对于邮件加载项来说没问题。