We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a5f0d2b commit 5490ccfCopy full SHA for 5490ccf
src/stores/settingStore.ts
@@ -30,9 +30,23 @@ export const useSettingStore = defineStore('setting', {
30
}),
31
getters: {
32
settingTree(): SettingTreeNode {
33
- return buildTree(Object.values(this.settings), (setting: SettingParams) =>
34
- setting.id.split('.')
+ const root = buildTree(
+ Object.values(this.settings),
35
+ (setting: SettingParams) => setting.id.split('.')
36
)
37
+
38
+ const floatingSettings = root.children.filter((node) => node.leaf)
39
+ if (floatingSettings.length) {
40
+ root.children = root.children.filter((node) => !node.leaf)
41
+ root.children.push({
42
+ key: 'Other',
43
+ label: 'Other',
44
+ leaf: false,
45
+ children: floatingSettings
46
+ })
47
+ }
48
49
+ return root
50
}
51
},
52
actions: {
0 commit comments