Skip to content

Commit

Permalink
fix(tauri): handle route params is string array
Browse files Browse the repository at this point in the history
  • Loading branch information
ziteh committed Jul 18, 2024
1 parent ad1854b commit e0be0e1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions elebox-tauri/src/views/Part.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script setup lang="ts">
import { onMounted, ref, reactive } from "vue";
import { invoke } from "@tauri-apps/api/tauri";
import { CustomField, PkgType, Supplier } from "../interface";
import PartCustomField from "../components/PartCustomField.vue";
import PartSupplier from "../components/PartSupplier.vue";
Expand All @@ -21,7 +20,7 @@ const part = ref<DbPart.Part>({
const qty_input = ref<number | undefined>(undefined);
const favorite = ref();
const alert = ref(false);
// const alert = ref(false);
const new_custom_field = ref<CustomField>({
name: "",
Expand Down Expand Up @@ -160,7 +159,12 @@ onMounted(() => {
route.params.origin_name !== undefined &&
route.params.origin_name !== ""
) {
origin_name.value = route.params.origin_name; // FIXME
if (Array.isArray(route.params.origin_name)) {
origin_name.value = route.params.origin_name[0];
} else {
origin_name.value = route.params.origin_name;
}
getPart(origin_name.value);
}
Expand Down

0 comments on commit e0be0e1

Please sign in to comment.