mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-17 00:12:11 +08:00
migrate i18n helper.js some code to typescript and migrate vue file to composition API and typescript
This commit is contained in:
+1
-1
@@ -19,7 +19,7 @@ export class AmapMapProvider implements MapProvider {
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
public asyncLoadAssets(language: string): Promise<unknown> {
|
||||
public asyncLoadAssets(language?: string): Promise<unknown> {
|
||||
if (AmapMapProvider.AMap) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ export class BaiduMapProvider implements MapProvider {
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
public asyncLoadAssets(language: string): Promise<unknown> {
|
||||
public asyncLoadAssets(language?: string): Promise<unknown> {
|
||||
if (BaiduMapProvider.BMap) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
export interface MapProvider {
|
||||
getWebsite(): string;
|
||||
asyncLoadAssets(language: string): Promise<unknown>;
|
||||
asyncLoadAssets(language?: string): Promise<unknown>;
|
||||
createMapInstance(): MapInstance | null;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ export class GoogleMapProvider implements MapProvider {
|
||||
return 'https://maps.google.com';
|
||||
}
|
||||
|
||||
public asyncLoadAssets(language: string): Promise<unknown> {
|
||||
public asyncLoadAssets(language?: string): Promise<unknown> {
|
||||
if (GoogleMapProvider.GoogleMap) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import { AmapMapProvider } from './amap.ts';
|
||||
|
||||
let mapProvider: MapProvider | null = null;
|
||||
|
||||
export function initMapProvider(language: string): void {
|
||||
export function initMapProvider(language?: string): void {
|
||||
const mapProviderType = getMapProvider();
|
||||
|
||||
if (LEAFLET_TILE_SOURCES[mapProviderType] || mapProviderType === 'custom') {
|
||||
|
||||
@@ -36,7 +36,7 @@ export class LeafletMapProvider implements MapProvider {
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
public asyncLoadAssets(language: string): Promise<unknown> {
|
||||
public asyncLoadAssets(language?: string): Promise<unknown> {
|
||||
return Promise.all([
|
||||
import('leaflet/dist/leaflet.css'),
|
||||
import('leaflet/dist/leaflet-src.esm.js').then(leaflet => LeafletMapProvider.Leaflet = leaflet)
|
||||
|
||||
+1
-1
@@ -540,7 +540,7 @@ export default {
|
||||
|
||||
return url;
|
||||
},
|
||||
generateGoogleMapJavascriptUrl: (language: string, callbackFnName: string): string => {
|
||||
generateGoogleMapJavascriptUrl: (language: string | undefined, callbackFnName: string): string => {
|
||||
let url = `${GOOGLE_MAP_JAVASCRIPT_URL}?key=${getGoogleMapAPIKey()}&libraries=core,marker&callback=${callbackFnName}`;
|
||||
|
||||
if (language) {
|
||||
|
||||
Reference in New Issue
Block a user