mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-14 23:17:33 +08:00
code refactor
This commit is contained in:
@@ -13,7 +13,6 @@ import { ref, computed, useTemplateRef } from 'vue';
|
||||
|
||||
import { useI18n } from '@/locales/helpers.ts';
|
||||
|
||||
import { copyObjectTo } from '@/lib/common.ts';
|
||||
import type { MapInstance, MapPosition } from '@/lib/map/base.ts';
|
||||
import { createMapInstance } from '@/lib/map/index.ts';
|
||||
|
||||
@@ -38,7 +37,7 @@ const mapSupported = computed<boolean>(() => !!mapInstance.value);
|
||||
const mapDependencyLoaded = computed<boolean>(() => mapInstance.value?.dependencyLoaded || false);
|
||||
|
||||
const finalMapStyle = computed<Record<string, unknown>>(() => {
|
||||
const styles: Record<string, unknown> = copyObjectTo(props.mapStyle, {});
|
||||
const styles: Record<string, unknown> = Object.assign({}, props.mapStyle);
|
||||
|
||||
if (props.height) {
|
||||
styles['height'] = props.height;
|
||||
|
||||
@@ -93,7 +93,6 @@ import { useI18nUIComponents, showLoading, hideLoading } from '@/lib/ui/mobile.t
|
||||
import { TransactionTag } from '@/models/transaction_tag.ts';
|
||||
import { useTransactionTagsStore } from '@/stores/transactionTag.ts';
|
||||
|
||||
import { copyArrayTo } from '@/lib/common.ts';
|
||||
import { type Framework7Dom, scrollToSelectedItem, scrollSheetToTop } from '@/lib/ui/mobile.ts';
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -117,7 +116,7 @@ const sheet = useTemplateRef<Sheet.Sheet>('sheet');
|
||||
const searchbar = useTemplateRef<Searchbar.Searchbar>('searchbar');
|
||||
|
||||
const filterContent = ref<string>('');
|
||||
const selectedItemIds = ref<string[]>(copyArrayTo(props.modelValue, []));
|
||||
const selectedItemIds = ref<string[]>(Array.from(props.modelValue));
|
||||
const newTag = ref<TransactionTag | null>(null);
|
||||
const heightClass = ref<string>(getHeightClass());
|
||||
|
||||
@@ -227,7 +226,7 @@ function onSearchBarFocus(): void {
|
||||
}
|
||||
|
||||
function onSheetOpen(event: { $el: Framework7Dom }): void {
|
||||
selectedItemIds.value = copyArrayTo(props.modelValue, []);
|
||||
selectedItemIds.value = Array.from(props.modelValue);
|
||||
newTag.value = null;
|
||||
scrollToSelectedItem(event.$el, '.page-content', 'li.list-item-selected');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user