Docs, add local deeplink to NotFound

This commit is contained in:
Dimitry Ivanov 2020-07-29 14:39:49 +03:00
parent 6953b2cfde
commit 3a25a1b911

View File

@ -9,7 +9,9 @@
href="https://github.com/noties/Markwon/raw/sample-store/markwon-debug.apk" href="https://github.com/noties/Markwon/raw/sample-store/markwon-debug.apk"
>sample app</a> and open >sample app</a> and open
<a :href="currentWindowLocation()" target="_blank">this link</a> again or try local one (if you already have app installed): <a :href="currentWindowLocation()" target="_blank">this link</a> again or try local one (if you already have app installed):
<a :href="buildLocalDeeplink()">{{ buildLocalDeeplink() }}</a> <a
:href="buildLocalDeeplink()"
>{{ buildLocalDeeplink() }}</a>
</span> </span>
</template> </template>
<template v-else> <template v-else>
@ -35,16 +37,17 @@ export default {
return msgs[Math.floor(Math.random() * msgs.length)]; return msgs[Math.floor(Math.random() * msgs.length)];
}, },
isSampleLink() { isSampleLink() {
const path = window.location.href; return /^.*\/app\/(sample|search).*$/.test(this.path());
return /^.*\/app\/(sample|search).*$/.test(path);
}, },
currentWindowLocation() { currentWindowLocation() {
return window.location.href; return window && window.location.href;
}, },
buildLocalDeeplink() { buildLocalDeeplink() {
const path = window.location.href; const link = /.*\/app\/((?:sample|search).*)/.exec(this.path())[1];
const link = /.*\/app\/((?:sample|search).*)/.exec(path)[1];
return "markwon://" + link; return "markwon://" + link;
},
path() {
return this.$route.fullPath;
} }
} }
}; };