mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-15 23:47:33 +08:00
code refactor
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { type Ref, ref, computed, useTemplateRef } from 'vue';
|
||||
import { ref, computed, useTemplateRef } from 'vue';
|
||||
|
||||
import { useI18n } from '@/locales/helpers.ts';
|
||||
|
||||
@@ -27,12 +27,12 @@ const props = defineProps<{
|
||||
const { tt, getCurrentLanguageInfo } = useI18n();
|
||||
|
||||
const mapContainer = useTemplateRef<HTMLElement>('mapContainer');
|
||||
const mapInstance: Ref<MapInstance | null> = ref(createMapInstance());
|
||||
const initCenter: Ref<MapPosition> = ref({
|
||||
const mapInstance = ref<MapInstance | null>(createMapInstance());
|
||||
const initCenter = ref<MapPosition>({
|
||||
latitude: 0,
|
||||
longitude: 0
|
||||
});
|
||||
const zoomLevel: Ref<number> = ref(1);
|
||||
const zoomLevel = ref<number>(1);
|
||||
|
||||
const mapSupported = computed<boolean>(() => {
|
||||
return !!mapInstance.value;
|
||||
@@ -56,7 +56,7 @@ const finalMapStyle = computed<Record<string, unknown>>(() => {
|
||||
return styles;
|
||||
});
|
||||
|
||||
function initMapView() {
|
||||
function initMapView(): void {
|
||||
let isFirstInit = false;
|
||||
let centerChanged = false;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { type Ref, ref, computed, watch, useTemplateRef } from 'vue';
|
||||
import { ref, computed, watch, useTemplateRef } from 'vue';
|
||||
|
||||
interface PinCode {
|
||||
value: string;
|
||||
@@ -38,11 +38,11 @@ const props = defineProps<{
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:modelValue', value: string): void
|
||||
(e: 'pincode:confirm', value: string): void
|
||||
(e: 'update:modelValue', value: string): void;
|
||||
(e: 'pincode:confirm', value: string): void;
|
||||
}>();
|
||||
|
||||
const codes: Ref<PinCode[]> = ref([]);
|
||||
const codes = ref<PinCode[]>([]);
|
||||
const pinCodeInputs = useTemplateRef<HTMLInputElement[]>('pin-code-input');
|
||||
|
||||
const finalPinCode = computed<string>(() => {
|
||||
|
||||
Reference in New Issue
Block a user