mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-27 07:48:13 +08:00
Tidy up the full frontend codebase and use optional chaining where possible (#620)
* Tidy up the full frontend codebase and use optional chaining where possible * Code review changes
This commit is contained in:
@@ -27,14 +27,12 @@
|
||||
</style>
|
||||
|
||||
<script lang="ts">
|
||||
import { DefineComponent, defineComponent, PropType } from "vue";
|
||||
import { defineComponent, PropType } from "vue";
|
||||
|
||||
import { IconName, IconSize, ICON_LIST } from "@/utilities/icons";
|
||||
import { IconName, icons } from "@/utilities/icons";
|
||||
|
||||
import LayoutRow from "@/components/layout/LayoutRow.vue";
|
||||
|
||||
const icons: Record<IconName, { component: DefineComponent; size: IconSize }> = ICON_LIST;
|
||||
|
||||
export default defineComponent({
|
||||
props: {
|
||||
icon: { type: String as PropType<IconName>, required: true },
|
||||
@@ -47,6 +45,7 @@ export default defineComponent({
|
||||
},
|
||||
components: {
|
||||
LayoutRow,
|
||||
// Import the components of all the icons
|
||||
...Object.fromEntries(Object.entries(icons).map(([name, data]) => [name, data.component])),
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user