feat(cli): set title by lang

This commit is contained in:
陈嘉涵
2019-12-09 17:07:01 +08:00
parent cf172f5cbc
commit 396002495f
10 changed files with 75 additions and 25 deletions
@@ -10,18 +10,18 @@ window.syncPath = function () {
const currentDir = router.history.current.path;
if (isInIframe) {
window.top.changePath(currentDir);
window.top.replacePath(currentDir);
} else if (!isMobile) {
const iframe = document.querySelector('iframe');
if (iframe) {
iframeReady(iframe, () => {
iframe.contentWindow.changePath(currentDir);
iframe.contentWindow.replacePath(currentDir);
});
}
}
};
window.changePath = function (path = '') {
window.replacePath = function (path = '') {
// should preserve hash for anchor
if (window.vueRouter.currentRoute.path !== path) {
window.vueRouter.replace(path).catch(() => {});
+1 -1
View File
@@ -1,7 +1,7 @@
function iframeReady(iframe, callback) {
const doc = iframe.contentDocument || iframe.contentWindow.document;
const interval = () => {
if (iframe.contentWindow.changePath) {
if (iframe.contentWindow.replacePath) {
callback();
} else {
setTimeout(() => {