@hostlink/nuxt-light 0.0.16 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useI18n } from 'vue-i18n';
|
|
3
3
|
import { useLight, q, getCurrentUser } from '../light';
|
|
4
|
-
import { ref, computed, reactive } from 'vue';
|
|
4
|
+
import { ref, computed, reactive, provide } from 'vue';
|
|
5
|
+
|
|
6
|
+
|
|
5
7
|
|
|
6
8
|
|
|
7
9
|
const light = useLight();
|
|
@@ -12,6 +14,7 @@ const props = defineProps({
|
|
|
12
14
|
});
|
|
13
15
|
|
|
14
16
|
let app = await q("app", ["menus"]);
|
|
17
|
+
const menus = ref(app.menus)
|
|
15
18
|
|
|
16
19
|
const i18n = useI18n();
|
|
17
20
|
i18n.locale = 'zh-hk';
|
|
@@ -98,6 +101,14 @@ const errors = computed(() => {
|
|
|
98
101
|
return light.getErrors();
|
|
99
102
|
})
|
|
100
103
|
|
|
104
|
+
const reloadMenu = async () => {
|
|
105
|
+
//menus.value = app.menus;
|
|
106
|
+
let app = await q("app", ["menus"]);
|
|
107
|
+
menus.value = app.menus
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
provide('reloadMenu', reloadMenu)
|
|
111
|
+
|
|
101
112
|
</script>
|
|
102
113
|
|
|
103
114
|
|
|
@@ -175,7 +186,7 @@ const errors = computed(() => {
|
|
|
175
186
|
@mouseover="isMouseOnDrawer = true">
|
|
176
187
|
<!-- drawer content -->
|
|
177
188
|
<q-scroll-area class="fit">
|
|
178
|
-
<l-menu v-for="menu in
|
|
189
|
+
<l-menu v-for="menu in menus" :value="menu" v-if="isAdmin" :dense="style.dense" />
|
|
179
190
|
</q-scroll-area>
|
|
180
191
|
</q-drawer>
|
|
181
192
|
|
|
@@ -198,7 +209,7 @@ const errors = computed(() => {
|
|
|
198
209
|
error }}
|
|
199
210
|
</q-card-section>
|
|
200
211
|
</q-card>
|
|
201
|
-
<slot />
|
|
212
|
+
<slot :reload="reloadMenu" />
|
|
202
213
|
</q-page-container>
|
|
203
214
|
|
|
204
215
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { reactive, ref, computed } from 'vue';
|
|
2
|
+
import { reactive, ref, computed, inject } from 'vue';
|
|
3
3
|
import { m, q } from "../../../light";
|
|
4
4
|
import { useQuasar } from 'quasar';
|
|
5
5
|
|
|
@@ -82,11 +82,12 @@ const onRemove = (node) => {
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
const splitterModel = ref(
|
|
85
|
+
const splitterModel = ref(38)
|
|
86
86
|
|
|
87
87
|
const selectedNode = computed(() => {
|
|
88
88
|
return tree1.value.getNodeByKey(selected.value);
|
|
89
89
|
});
|
|
90
|
+
const reloadMenu = inject('reloadMenu')
|
|
90
91
|
|
|
91
92
|
const onSave = () => {
|
|
92
93
|
|
|
@@ -107,8 +108,10 @@ const onSave = () => {
|
|
|
107
108
|
position: 'top',
|
|
108
109
|
timeout: 1000,
|
|
109
110
|
});
|
|
110
|
-
}
|
|
111
111
|
|
|
112
|
+
//
|
|
113
|
+
}
|
|
114
|
+
reloadMenu()
|
|
112
115
|
});
|
|
113
116
|
}
|
|
114
117
|
|
|
@@ -1,8 +1,20 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { inject } from "vue";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
const reloadMenu = inject('reloadMenu')
|
|
6
|
+
|
|
7
|
+
const onClick = (parent) => {
|
|
8
|
+
reloadMenu()
|
|
9
|
+
|
|
10
|
+
}
|
|
11
|
+
</script>
|
|
1
12
|
<template>
|
|
2
13
|
<q-page padding>
|
|
3
14
|
<l-card>
|
|
4
15
|
<q-card-section>
|
|
5
|
-
|
|
16
|
+
Helloas
|
|
17
|
+
<q-btn label="click" @click="onClick($parent)"></q-btn>
|
|
6
18
|
</q-card-section>
|
|
7
19
|
</l-card>
|
|
8
20
|
</q-page>
|