Skip to content

Commit 7a49502

Browse files
committed
fix(OrderChips): Fix the order of the chips
1 parent 497c563 commit 7a49502

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

components/Step.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,14 @@
9090
function decrement_step() {
9191
stepper_tree.current_step_index--
9292
}
93+
94+
const sortedChips = computed(() => {
95+
const chips = steps.value[props.step_index]?.chips || []
96+
return [...chips].sort((a, b) =>
97+
a.localeCompare(b, undefined, {
98+
numeric: true,
99+
sensitivity: "base",
100+
}),
101+
)
102+
})
93103
</script>

stores/treeview.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const useTreeviewStore = defineStore("treeview", () => {
1+
export const use_treeview_store = defineStore("treeview", () => {
22
const dataStyleStore = useDataStyleStore()
33

44
/** State **/
@@ -15,9 +15,16 @@ export const useTreeviewStore = defineStore("treeview", () => {
1515
function addItem(geodeObject, displayed_name, id, object_type) {
1616
dataStyleStore.addDataStyle(id, geodeObject, object_type)
1717
const child = { title: displayed_name, id, object_type }
18+
1819
for (let i = 0; i < items.value.length; i++) {
1920
if (items.value[i].title === geodeObject) {
2021
items.value[i].children.push(child)
22+
items.value[i].children.sort((a, b) =>
23+
a.title.localeCompare(b.title, undefined, {
24+
numeric: true,
25+
sensitivity: "base",
26+
}),
27+
)
2128
selection.value.push(child)
2229
return
2330
}

0 commit comments

Comments
 (0)