mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-04-26 09:20:18 +08:00
refactor: standardize app property names and improve TypeScript definitions
- Updated property names in AppCard.vue, AppDetailModal.vue, AppGrid.vue, and other components to use camelCase for consistency. - Enhanced TypeScript definitions for props and emits in various components to improve type safety. - Refactored download status handling in processInstall.ts to align with updated App interface. - Improved error handling and type definitions in DownloadDetail.vue and related components. - Added optional properties and refined existing interfaces in typedefinition.ts for better clarity and usability.
This commit is contained in:
@@ -33,37 +33,28 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { defineProps, defineEmits } from 'vue';
|
||||
<script setup lang="ts">
|
||||
import ThemeToggle from './ThemeToggle.vue';
|
||||
import amberLogo from '../assets/imgs/amber-pm-logo.png';
|
||||
|
||||
defineProps({
|
||||
categories: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
activeCategory: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
categoryCounts: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
isDarkTheme: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
}
|
||||
});
|
||||
defineProps<{
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
categories: Record<string, any>;
|
||||
activeCategory: string;
|
||||
categoryCounts: Record<string, number>;
|
||||
isDarkTheme: boolean;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits(['toggle-theme', 'select-category']);
|
||||
const emit = defineEmits<{
|
||||
(e: 'toggle-theme'): void;
|
||||
(e: 'select-category', category: string): void;
|
||||
}>();
|
||||
|
||||
const toggleTheme = () => {
|
||||
emit('toggle-theme');
|
||||
};
|
||||
|
||||
const selectCategory = (category) => {
|
||||
const selectCategory = (category: string) => {
|
||||
emit('select-category', category);
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user