mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-19 17:24:26 +08:00
migrate index.js to typescript
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import uaParser from 'ua-parser-js';
|
import uaParser from 'ua-parser-js';
|
||||||
|
|
||||||
function isMobileDevice() {
|
function isMobileDevice(): boolean {
|
||||||
if (!navigator.userAgent) {
|
if (!navigator.userAgent) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -20,8 +20,8 @@ function isMobileDevice() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function navigate(type) {
|
function navigate(type: string): void {
|
||||||
if (process.env.NODE_ENV === 'production') {
|
if (__EZBOOKKEEPING_IS_PRODUCTION__) {
|
||||||
window.location.replace(`${type}/`);
|
window.location.replace(`${type}/`);
|
||||||
} else {
|
} else {
|
||||||
window.location.replace(`${type}.html`);
|
window.location.replace(`${type}.html`);
|
||||||
+1
-1
@@ -66,6 +66,6 @@
|
|||||||
</noscript>
|
</noscript>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
|
||||||
<script type="module" src="./index-main.js"></script>
|
<script type="module" src="./index-main.ts"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user